FIND YOUR NEXT FEW LINES

Results for “STRING_SPLIT”

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

228 snippets foundClear filters
Arduino / CText & bounded buffers

Compare a command case-sensitively

Arduino / C: strcmp returns zero when both null-terminated strings match.

Arduino / C✓ Tested
PythonDates & time zones

Convert a duration to hours and minutes

Python: Use divmod to split nonnegative whole seconds into display components.

Python✓ Tested
CStrings

Convert ASCII text to uppercase

Convert characters with toupper while avoiding signed-char undefined behavior.

C✓ Tested
JavaScriptNumbers & numeric validation

Convert between integer bases

JavaScript: Supply a radix when parsing a nondecimal integer string.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Convert between integer bases

TypeScript: Supply a radix when parsing a nondecimal integer string.

TypeScript✓ Tested
CStrings

Copy text into a fixed buffer

Use snprintf and check for truncation when copying a C string.

C✓ Tested
C#JSON & binary formats

Decode hexadecimal bytes

C#: FromHexString and ToHexString handle binary data without manually parsing pairs of characters.

C#✓ Tested
JavaScriptNumbers & numeric validation

Detect NaN without converting the input

JavaScript: Number.isNaN tests the special numeric value instead of applying string-to-number conversion.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Detect NaN without converting the input

TypeScript: Number.isNaN tests the special numeric value instead of applying string-to-number conversion.

TypeScript✓ Tested
JavaScriptNumbers & numeric validation

Display a number with a fixed decimal width

JavaScript: toFixed returns a formatted string rather than a numeric value.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Display a number with a fixed decimal width

TypeScript: toFixed returns a formatted string rather than a numeric value.

TypeScript✓ Tested
PowerShellStructured formats & encodings

Encode and decode UTF-8 text with Base64

PowerShell: Convert the string to bytes explicitly before Base64 encoding.

PowerShell✓ Tested