Results for “Dates & numeric validation”
Small, practical examples. Search by task or narrow things down below.
Parse an unsigned hexadecimal integer
C: Use an explicit base and check both range and full consumption.
C✓ Tested
Pass a block of behavior as an argument
PowerShell: Invoke a scriptblock with the call operator and an explicit input value.
PowerShell✓ Tested
Pass a variable to one command
Linux Commands: Use env to supply a child process value without setting it permanently in the parent shell.
Linux Commands✓ Tested
Preserve a failure after local cleanup
PowerShell: A bare throw inside catch rethrows the current exception.
PowerShell✓ Tested
Process the lines of an in-memory string
Java: Use String.lines to handle common line terminators without retaining them.
Java✓ Tested
Quote a literal search term for a regex
C#: Regex.Escape prevents metacharacters in a literal term from changing the pattern.
C#✓ Tested
Read a quoted string containing spaces
C++: The quoted manipulator extracts a quoted field without splitting at internal spaces.
C++✓ Tested
Read an ISO week date
Linux Commands: Use ISO week year, week number, and weekday directives together.
Linux Commands✓ Tested
Read an ISO week number
Python: Use isocalendar because ISO week years can differ from calendar years near January.
Python✓ Tested
Read an ISO week year and week number
Java: Use ISO week fields together because a week can belong to the previous calendar year.
Java✓ Tested
Read an uncontrolled form with FormData
Read an uncontrolled form with FormData with a small React component and explicit browser behavior.
React✓ Tested
Reject an integer outside a byte’s range
Reject an integer outside a byte’s range using a complete Go program with explicit sample inputs.
Go✓ Tested