FIND YOUR NEXT FEW LINES

Results for “Strings & Unicode”

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

112 snippets foundClear filters
PythonStrings & dates

Join strings with a separator

Combine a list of strings into one readable string with a separator between each item.

string✓ Tested
JavaStrings

Join strings with a separator

Build a Java string from several values using String.join.

Java✓ Tested
C++Strings

Join strings with a separator

Use an output string stream to join C++ values without a trailing separator.

C++✓ Tested
JavaScriptUTC date operations

Sort timestamp strings by their parsed instants

JavaScript: Compare epoch values explicitly when date strings may contain different offsets.

JavaScript✓ Tested
TypeScriptUTC date operations

Sort timestamp strings by their parsed instants

TypeScript: Compare epoch values explicitly when date strings may contain different offsets.

TypeScript✓ Tested
CStrings & byte buffers

Append text only when the destination has enough capacity

C: Check the combined lengths including the terminator before using strcat.

C✓ Tested
GoStrings & text

Build text incrementally

Build text incrementally using a complete Go program with explicit sample inputs.

Go✓ Tested
CStrings & byte buffers

Check a literal filename suffix

C: Check lengths before subtracting so a short input cannot produce an invalid pointer.

C✓ Tested
CStrings & byte buffers

Check a literal string prefix

C: strncmp compares at most the prefix length; both inputs must be valid strings.

C✓ Tested
PowerShellStrings & literal text

Check a string prefix using ordinal comparison

PowerShell: Supply an explicit comparison rule for protocol identifiers.

PowerShell✓ Tested
PowerShellStrings & literal text

Check a suffix without case sensitivity

PowerShell: Use an ordinal case-insensitive comparison for a known filename extension.

PowerShell✓ Tested
JavaScriptText handling & Unicode

Check whether text ends with a suffix

JavaScript: Use endsWith for a literal case-sensitive ending.

JavaScript✓ Tested