FIND YOUR NEXT FEW LINES

Results for “valid”

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

188 snippets foundClear filters
JavaScriptNumbers & numeric validation

Compare bounded floating-point results with a tolerance

JavaScript: Use an absolute error threshold for values known to be near one.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Compare bounded floating-point results with a tolerance

TypeScript: Use an absolute error threshold for values known to be near one.

TypeScript✓ Tested
PythonText validation & encoding

Compare Unicode text without case

Python: Casefold handles more Unicode case mappings than lower for caseless comparison.

Python✓ Tested
PowerShellDates & numeric validation

Compute beyond the fixed-width integer range

PowerShell: BigInteger keeps an exact result when ordinary integer types are too small.

PowerShell✓ Tested
ReactForms & validation

Control a multiline text field

Control a multiline text field with a small React component and explicit browser behavior.

React✓ Tested
ReactForms & validation

Control a radio-button group

Control a radio-button group with a small React component and explicit browser behavior.

React✓ Tested
C++Text validation & parsing

Convert ASCII text to lowercase safely

C++: Cast each byte to unsigned char before using the cctype function.

C++✓ Tested
JavaScriptNumbers & numeric validation

Convert between integer bases

JavaScript: Supply a radix when parsing a nondecimal integer string.

JavaScript✓ Tested
TypeScriptNumbers & numeric validation

Convert between integer bases

TypeScript: Supply a radix when parsing a nondecimal integer string.

TypeScript✓ Tested
PythonText validation & encoding

Convert hexadecimal text to bytes

Python: Use bytes.fromhex for a readable byte representation and hex for the reverse conversion.

Python✓ Tested
SQL ServerSelect & page

Convert text without raising a conversion error

Return NULL when a numeric conversion fails.

TRY_CONVERT✓ Tested
PowerShellDates & numeric validation

Convert Unix seconds into an aware UTC timestamp

PowerShell: DateTimeOffset.FromUnixTimeSeconds creates a value with an explicit UTC offset.

PowerShell✓ Tested