FIND YOUR NEXT FEW LINES

Results for “character”

Small, practical examples. Search by task or narrow things down below.

205 snippets foundClear filters
C#Getting Started

Read the beginning of a text value

C#: Extract or display the first three ASCII characters from a known nonempty string.

C#✓ Tested
JavaGetting Started

Read the beginning of a text value

Java: Extract or display the first three ASCII characters from a known nonempty string.

Java✓ Tested
JavaScriptGetting Started

Read the beginning of a text value

JavaScript: Extract or display the first three ASCII characters from a known nonempty string.

JavaScript✓ Tested
TypeScriptGetting Started

Read the beginning of a text value

TypeScript: Extract or display the first three ASCII characters from a known nonempty string.

TypeScript✓ Tested
C++Getting Started

Read the beginning of a text value

C++: Extract or display the first three ASCII characters from a known nonempty string.

C++✓ Tested
CGetting Started

Read the beginning of a text value

C: Extract or display the first three ASCII characters from a known nonempty string.

C✓ Tested
Arduino / CEEPROM & program memory

Reject an unsupported settings version

Arduino / C: A version byte lets firmware fall back when stored settings use another format.

Arduino / C✓ Tested
Arduino / CArrays & embedded state

Reject insertion when a fixed queue is full

Arduino / C: Track a count separately from circular read and write positions.

Arduino / C✓ Tested
Arduino / CSensor calculations

Reject one outlier with a median-of-three filter

Arduino / C: Sorting three values leaves the median in the middle.

Arduino / C✓ Tested
PythonText validation & encoding

Remove a known prefix safely

Python: Use removeprefix instead of lstrip when removing a literal prefix rather than a set of characters.

Python✓ Tested
Linux CommandsTransforming text

Remove blank or whitespace-only lines

Linux Commands: Use a POSIX character class so tabs and spaces are handled together.

Linux Commands✓ Tested
SQLText cleanup & matching

Remove surrounding spaces from text

SQL: TRIM removes leading and trailing space characters by default.

SQL✓ Tested