FIND YOUR NEXT FEW LINES

Results for “valid”

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

188 snippets foundClear filters
PowerShellFunctions & parameter validation

Keep function-local assignments separate from caller state

PowerShell: Ordinary function assignments create local variables rather than replacing the caller’s variable.

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

Normalize canonically equivalent Unicode strings

C#: Normalize to NFC before an ordinal comparison of equivalent character sequences.

C#✓ Tested
PythonText validation & encoding

Normalize equivalent Unicode strings

Python: Normalize to NFC before comparing canonically equivalent text.

Python✓ Tested
C#Text validation & encoding

Pad a numeric label to a fixed width

C#: Use a numeric format specifier to add leading zeroes.

C#✓ Tested
GoErrors & validation

Parse a Boolean configuration value

Parse a Boolean configuration value using a complete Go program with explicit sample inputs.

Go✓ Tested
PowerShellDates & numeric validation

Parse a hexadecimal integer

PowerShell: Convert.ToInt32 accepts an explicit base for a validated hexadecimal string.

PowerShell✓ Tested
GoErrors & validation

Parse an email address syntax

Parse an email address syntax using a complete Go program with explicit sample inputs.

Go✓ 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
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