FIND YOUR NEXT FEW LINES

Results for “Dates & numeric validation”

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

303 snippets foundClear filters
CNumeric parsing & arithmetic

Parse an unsigned hexadecimal integer

C: Use an explicit base and check both range and full consumption.

C✓ Tested
PowerShellFunctions & parameter validation

Pass a block of behavior as an argument

PowerShell: Invoke a scriptblock with the call operator and an explicit input value.

PowerShell✓ Tested
Linux CommandsDates & process utilities

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
PowerShellFunctions & parameter validation

Preserve a failure after local cleanup

PowerShell: A bare throw inside catch rethrows the current exception.

PowerShell✓ Tested
JavaText validation & formatting

Process the lines of an in-memory string

Java: Use String.lines to handle common line terminators without retaining them.

Java✓ Tested
C#Text validation & encoding

Quote a literal search term for a regex

C#: Regex.Escape prevents metacharacters in a literal term from changing the pattern.

C#✓ Tested
C++Text validation & parsing

Read a quoted string containing spaces

C++: The quoted manipulator extracts a quoted field without splitting at internal spaces.

C++✓ Tested
Linux CommandsDates & process utilities

Read an ISO week date

Linux Commands: Use ISO week year, week number, and weekday directives together.

Linux Commands✓ Tested
PythonDates & time zones

Read an ISO week number

Python: Use isocalendar because ISO week years can differ from calendar years near January.

Python✓ Tested
JavaDates & time zones

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
ReactForms & validation

Read an uncontrolled form with FormData

Read an uncontrolled form with FormData with a small React component and explicit browser behavior.

React✓ Tested
GoErrors & validation

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