FIND YOUR NEXT FEW LINES

Results for “valid”

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

188 snippets foundClear filters
PowerShellDates & numeric validation

Count days between calendar dates

PowerShell: Parse an unambiguous format before subtracting date values.

PowerShell✓ Tested
JavaText validation & formatting

Count Unicode code points

Java: Use codePointCount when supplementary characters should count as one rather than two UTF-16 units.

Java✓ Tested
JavaScriptNumbers & numeric validation

Detect NaN without converting the input

JavaScript: Number.isNaN tests the special numeric value instead of applying string-to-number conversion.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Detect NaN without converting the input

TypeScript: Number.isNaN tests the special numeric value instead of applying string-to-number conversion.

TypeScript✓ Tested
PowerShellFunctions & parameter validation

Dispatch values with wildcard patterns

PowerShell: Switch -Wildcard interprets shell-style matching patterns for each clause.

PowerShell✓ Tested
JavaScriptNumbers & numeric validation

Display a number with a fixed decimal width

JavaScript: toFixed returns a formatted string rather than a numeric value.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Display a number with a fixed decimal width

TypeScript: toFixed returns a formatted string rather than a numeric value.

TypeScript✓ Tested
JavaScriptNumbers & numeric validation

Drop the fractional part toward zero

JavaScript: Math.trunc differs from floor for negative inputs.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Drop the fractional part toward zero

TypeScript: Math.trunc differs from floor for negative inputs.

TypeScript✓ Tested
PythonText validation & encoding

Encode and decode binary data as Base64

Python: Use Base64 when a text format must carry bytes; it is encoding, not encryption.

Python✓ Tested
PowerShellFunctions & parameter validation

Enforce a numeric range at a function boundary

PowerShell: ValidateRange performs argument validation before work begins.

PowerShell✓ Tested
C#Text validation & encoding

Enumerate Unicode code points

C#: EnumerateRunes combines surrogate pairs into Unicode scalar values.

C#✓ Tested