Results for “Strings & literal text”
Small, practical examples. Search by task or narrow things down below.
Check a literal suffix in C++17
C++: Check lengths before subtracting to avoid an unsigned underflow.
C++✓ 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
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
Quote a literal search term for a regex
C#: Regex.Escape prevents metacharacters in a literal term from changing the pattern.
C#✓ Tested
Replace a literal substring
SQL: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQL✓ Tested
Replace a literal substring
SQL Server: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQL Server✓ Tested
Replace a literal substring
Postgres: REPLACE performs a literal replacement rather than a regular-expression substitution.
Postgres✓ Tested
Replace a literal substring
SQLite: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQLite✓ Tested
Replace a literal substring
Replace a literal substring in a complete Rust program using the standard library.
Rust✓ Tested
Search for a literal LIKE wildcard
SQL: Declare an escape character so a percent sign in the pattern is literal.
SQL✓ Tested