FIND YOUR NEXT FEW LINES

Results for “Text validation & parsing”

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

547 snippets foundClear filters
C#Text validation & encoding

Build text incrementally with StringBuilder

C#: Append fragments instead of repeatedly concatenating intermediate strings in a loop.

C#✓ 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
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
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
PythonText validation & encoding

Escape text for HTML content

Python: Use html.escape before placing plain text in an HTML text or quoted attribute context.

Python✓ Tested
C#Text validation & encoding

Extract all integer tokens from text

C#: Enumerate Match objects returned by Regex.Matches with an explicit timeout.

C#✓ Tested
JavaText validation & formatting

Extract text between known positions

Java: Java substring uses a start-inclusive, end-exclusive range of UTF-16 indices.

Java✓ Tested
ReactForms & validation

Keep numeric input text until conversion

Keep numeric input text until conversion with a small React component and explicit browser behavior.

React✓ Tested
Bash ScriptsText parsing & arithmetic

Print text containing percent characters literally

Bash Scripts: Never use untrusted text as the printf format string.

Bash Scripts✓ Tested
JavaText validation & formatting

Repeat text a fixed number of times

Java: Use String.repeat with a nonnegative repetition count.

Java✓ Tested