FIND YOUR NEXT FEW LINES

Results for “Functions & parameter validation”

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

202 snippets foundClear filters
RustFunctions & data types

Implement a method on a struct

Implement a method on a struct in a complete Rust program using the standard library.

Rust✓ Tested
C++Text validation & parsing

Inspect a substring without allocating a copy

C++: A string_view refers to existing storage and must not outlive that storage.

C++✓ Tested
GoErrors & validation

Inspect a typed conversion error

Inspect a typed conversion error using a complete Go program with explicit sample inputs.

Go✓ Tested
GoFunctions & types

Inspect a value with a type switch

Inspect a value with a type switch using a complete Go program with explicit sample inputs.

Go✓ Tested
C++Text validation & parsing

Iterate over all regular-expression matches

C++: A regex iterator yields successive matches without manually updating an offset.

C++✓ Tested
CStructures & function interfaces

Keep caller data unchanged by passing a structure by value

C: A value parameter is a copy of the original structure.

C✓ 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
GoFunctions & types

Mutate a struct through a pointer receiver

Mutate a struct through a pointer receiver using a complete Go program with explicit sample inputs.

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