Results for “Strings & text”
Small, practical examples. Search by task or narrow things down below.
Append text only when the destination has enough capacity
C: Check the combined lengths including the terminator before using strcat.
C✓ Tested
Build text incrementally
Build text incrementally using a complete Go program with explicit sample inputs.
Go✓ Tested
Compare ASCII text ignoring case
Compare ASCII text ignoring case in a complete Rust program using the standard library.
Rust✓ Tested
Compare text ignoring case
Compare text ignoring case using a complete Go program with explicit sample inputs.
Go✓ Tested
Join several strings with a separator
PowerShell: The join operator returns one string from an input collection.
PowerShell✓ Tested
Normalize canonically equivalent Unicode strings
C#: Normalize to NFC before an ordinal comparison of equivalent character sequences.
C#✓ Tested
Normalize equivalent Unicode strings
Python: Normalize to NFC before comparing canonically equivalent text.
Python✓ Tested
Replace literal text
Replace literal text using a complete Go program with explicit sample inputs.
Go✓ Tested
Split simple delimited text in place
C: strtok inserts terminators into a writable buffer and skips repeated delimiter characters.
C✓ Tested
Split text on a simple delimiter
PowerShell: The split operator uses a regular expression; this delimiter has no special regex meaning.
PowerShell✓ Tested
Trim whitespace around text
Trim whitespace around text in a complete Rust program using the standard library.
Rust✓ Tested
Check a string prefix using ordinal comparison
PowerShell: Supply an explicit comparison rule for protocol identifiers.
PowerShell✓ Tested