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

Reset controlled form state

Reset controlled form state with a small React component and explicit browser behavior.

React✓ Tested
PowerShellCommands & execution context

Restore an environment value after temporary use

PowerShell: Use finally so temporary process configuration does not leak to subsequent work; remove the entry when it was originally absent.

PowerShell✓ Tested
PowerShellCommands & execution context

Restore the working location after an operation

PowerShell: Push-Location and Pop-Location manage a directory stack; finally ensures restoration.

PowerShell✓ Tested
PowerShellFunctions & parameter validation

Restrict a function parameter to known choices

PowerShell: ValidateSet rejects unsupported values before the function body executes.

PowerShell✓ Tested
PowerShellFunctions & parameter validation

Return a collection as one pipeline object

PowerShell: The unary comma prevents the returned array from being enumerated at this boundary.

PowerShell✓ Tested
PowerShellDates & numeric validation

Round a decimal with a chosen midpoint rule

PowerShell: Use decimal input and an explicit rounding policy for a reproducible decimal result.

PowerShell✓ Tested
CNumeric parsing & arithmetic

Round a halfway floating-point value

C: The C round function rounds halfway cases away from zero.

C✓ Tested
CNumeric parsing & arithmetic

Round downward and upward independently

C: floor and ceil round toward negative and positive infinity respectively.

C✓ Tested
C++Numeric parsing & calculations

Round halfway floating-point values away from zero

C++: std::round has an explicit halfway rule different from truncation.

C++✓ Tested
PowerShellFunctions & parameter validation

Run cleanup after a caught exception

PowerShell: Use finally for cleanup that must occur after either success or failure.

PowerShell✓ Tested
SQLiteQueries & text

Search a small FTS5 table

Use SQLite’s full-text index to match a term.

FTS5✓ Tested
SQLText cleanup & matching

Search for a literal LIKE wildcard

SQL: Declare an escape character so a percent sign in the pattern is literal.

SQL✓ Tested