FIND YOUR NEXT FEW LINES

Results for “Strings & Unicode”

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

112 snippets foundClear filters
JavaScriptText handling & Unicode

Compare canonically equivalent Unicode text

JavaScript: Normalize to NFC before comparing equivalent composed and decomposed text.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Compare canonically equivalent Unicode text

TypeScript: Normalize to NFC before comparing equivalent composed and decomposed text.

TypeScript✓ Tested
CStrings & byte buffers

Compare two C strings for equality

C: strcmp returns zero only when both null-terminated byte strings are equal.

C✓ Tested
PythonText validation & encoding

Compare Unicode text without case

Python: Casefold handles more Unicode case mappings than lower for caseless comparison.

Python✓ Tested
JavaText validation & formatting

Count Unicode code points

Java: Use codePointCount when supplementary characters should count as one rather than two UTF-16 units.

Java✓ Tested
GoGetting Started

Count Unicode code points

Count Unicode code points using a complete Go program with explicit sample inputs.

Go✓ Tested
JavaScriptText handling & Unicode

Count Unicode code points in a string

JavaScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.

JavaScript✓ Tested
TypeScriptText handling & Unicode

Count Unicode code points in a string

TypeScript: String iteration combines surrogate pairs, unlike the UTF-16 length property.

TypeScript✓ Tested
Bash ScriptsParameter expansion

Distinguish unset variables from empty strings

Bash Scripts: Omitting the colon tests only whether a variable is unset; including it also treats an empty value as missing.

Bash Scripts✓ Tested
C#Text validation & encoding

Enumerate Unicode code points

C#: EnumerateRunes combines surrogate pairs into Unicode scalar values.

C#✓ Tested
JavaStream transformations

Group strings by their length

Java: Choose a TreeMap supplier when group keys must have deterministic order.

Java✓ Tested
PowerShellStrings & literal text

Join several strings with a separator

PowerShell: The join operator returns one string from an input collection.

PowerShell✓ Tested