FIND YOUR NEXT FEW LINES

Results for “Strings & literal text”

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

495 snippets foundClear filters
CStrings & byte buffers

Compare two C strings for equality

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

C✓ Tested
Bash ScriptsGetting Started

Compare two text values

Bash Scripts: Compare two text values with a small standalone Bash program.

Bash Scripts✓ Tested
PythonText validation & encoding

Compare Unicode text without case

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

Python✓ Tested
ReactForms & validation

Control a multiline text field

Control a multiline text field with a small React component and explicit browser behavior.

React✓ Tested
ReactGetting Started

Control a text input

Control a text input with a small React component and explicit browser behavior.

React✓ Tested
C++Text validation & parsing

Convert ASCII text to lowercase safely

C++: Cast each byte to unsigned char before using the cctype function.

C++✓ Tested
CBinary formats & structured parsing

Convert ASCII text to lowercase safely

C: Cast to unsigned char before calling ctype functions on a possibly signed char.

C✓ Tested
PowerShellStructured formats & encodings

Convert between hexadecimal text and bytes

PowerShell: Use the .NET hexadecimal helpers instead of parsing byte pairs manually.

PowerShell✓ Tested
PythonText validation & encoding

Convert hexadecimal text to bytes

Python: Use bytes.fromhex for a readable byte representation and hex for the reverse conversion.

Python✓ Tested
SQL ServerSelect & page

Convert text without raising a conversion error

Return NULL when a numeric conversion fails.

TRY_CONVERT✓ Tested
PowerShellGetting Started

Create an array of text values

PowerShell: Create an array of text values using PowerShell 7.

PowerShell✓ Tested
CSSType & reading flow

Display a label in uppercase without changing its text

CSS: Text-transform changes visual casing while preserving the DOM’s source text.

CSS✓ Tested