Results for “Strings & text”
Small, practical examples. Search by task or narrow things down below.
Check whether text is valid JSON
Reject malformed input before processing it.
json_valid✓ Tested
Check whether text starts with a prefix
JavaScript: Use startsWith for a literal case-sensitive prefix comparison.
JavaScript✓ Tested
Check whether text starts with a prefix
TypeScript: Use startsWith for a literal case-sensitive prefix comparison.
TypeScript✓ Tested
Choose labels from a language context
Choose labels from a language context with a small React component and explicit browser behavior.
React✓ Tested
Collect borrowed values into owned strings
Collect borrowed values into owned strings in a complete Rust program using the standard library.
Rust✓ Tested
Combine text values with a separator
SQL: Use the concatenation operator supported by the selected SQL dialect.
SQL✓ Tested
Combine text values with a separator
SQL Server: Use the concatenation operator supported by the selected SQL dialect.
SQL Server✓ Tested
Combine text values with a separator
Postgres: Use the concatenation operator supported by the selected SQL dialect.
Postgres✓ Tested
Combine text values with a separator
SQLite: Use the concatenation operator supported by the selected SQL dialect.
SQLite✓ Tested
Combine text with a name
Python: Construct a greeting from a fixed prefix and a stored name.
Python✓ Tested
Combine text with a name
C#: Construct a greeting from a fixed prefix and a stored name.
C#✓ Tested
Combine text with a name
Java: Construct a greeting from a fixed prefix and a stored name.
Java✓ Tested