Results for “to_char”
Small, practical examples. Search by task or narrow things down below.
Print text containing percent characters literally
Bash Scripts: Never use untrusted text as the printf format string.
Bash Scripts✓ Tested
Read a string’s character length
Bash Scripts: Bash parameter length counts characters under the current locale.
Bash Scripts✓ Tested
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