Results for “character”
Small, practical examples. Search by task or narrow things down below.
Read characters without confusing EOF with a byte
C: Store fgetc in int so every unsigned-char value remains distinguishable from EOF.
C✓ Tested
Read one character from ASCII text
Python: Use a valid zero-based index to read the first character.
Python✓ Tested
Read one character from ASCII text
C#: Use a valid zero-based index to read the first character.
C#✓ Tested
Read one character from ASCII text
Java: Use a valid zero-based index to read the first character.
Java✓ Tested
Read one character from ASCII text
JavaScript: Use a valid zero-based index to read the first character.
JavaScript✓ Tested
Read one character from ASCII text
TypeScript: Use a valid zero-based index to read the first character.
TypeScript✓ Tested
Read one character from ASCII text
C++: Use a valid zero-based index to read the first character.
C++✓ Tested
Read one character from ASCII text
C: Use a valid zero-based index to read the first character.
C✓ Tested
Read one character from serial input
Wait for an incoming byte without blocking the main loop.
Serial.available✓ Tested
Reject an integer with trailing characters
Arduino / C: strtol exposes an end pointer so a parser can require the entire token.
Arduino / C✓ Tested
Remove carriage-return characters
Linux Commands: Use tr -d to remove CR characters from Windows-style line endings.
Linux Commands✓ Tested
Split text on several separator characters
JavaScript: A regex character class can recognize alternative simple delimiters.
JavaScript✓ Tested