Results for “Text validation & parsing”
Small, practical examples. Search by task or narrow things down below.
Use React 19’s provider shorthand
Use React 19’s provider shorthand with a small React component and explicit browser behavior.
React✓ Tested
Validate a complete floating-point input
C: strtod exposes both the stopping position and range errors; reject nonfinite results when required.
C✓ Tested
Validate a finite numeric value without coercion
JavaScript: Number.isFinite rejects numeric strings as well as NaN and infinity.
JavaScript✓ Tested
Validate a finite numeric value without coercion
TypeScript: Number.isFinite rejects numeric strings as well as NaN and infinity.
TypeScript✓ Tested
Validate a simple C-style ASCII identifier
C: Check the first character separately from subsequent characters and reject empty input.
C✓ Tested
Validate an unknown value with a type guard
Check a field before treating unknown data as a typed object.
unknown✓ Tested
Validate UTF-8 bytes
Validate UTF-8 bytes using a complete Go program with explicit sample inputs.
Go✓ Tested
Write a multiline string without expanding variables
PowerShell: A single-quoted here-string preserves dollar signs literally.
PowerShell✓ Tested
Limit a numeric input to an inclusive range
HTML: Number inputs expose range validation separately from the entered text.
HTML✓ Tested
Add days to a date
Use DATEADD for date arithmetic.
DATEADD✓ Tested
Add days to a date
Use a date modifier for calendar arithmetic.
date✓ Tested
Append a line
Append UTF-8 text without replacing existing C# file contents.
C#✓ Tested