FIND YOUR NEXT FEW LINES

Results for “save”

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

1671 snippets foundClear filters
Bash ScriptsArguments & decisions

Parse a small set of long options

Bash Scripts: Use a loop and case statement to consume a value-bearing long option.

Bash Scripts✓ Tested
PythonFunctions & error handling

Parse a typed command-line option

Python: Use argparse to validate and convert an integer option.

Python✓ Tested
JavaEncoding & structured values

Parse a UUID and inspect its version

Java: Use UUID.fromString for a standard UUID value.

Java✓ Tested
GoErrors & validation

Parse an email address syntax

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

Go✓ Tested
JavaPrecise numeric calculations

Parse an integer in another base

Java: Supply an explicit radix to Integer.parseInt.

Java✓ Tested
JavaNumbers & dates

Parse an integer safely

Handle invalid Java integer input with NumberFormatException.

Java✓ Tested
CNumbers & memory

Parse an integer with validation

Validate range and trailing characters when parsing a C integer with strtol.

C✓ Tested
PowerShellDates & numeric validation

Parse an integer without throwing on invalid input

PowerShell: TryParse reports conversion success separately from its output value.

PowerShell✓ Tested
PythonDates & time zones

Parse an ISO calendar date

Python: Use date.fromisoformat and inspect the calendar components.

Python✓ Tested
CNumeric parsing & arithmetic

Parse an unsigned hexadecimal integer

C: Use an explicit base and check both range and full consumption.

C✓ Tested
Bash ScriptsText parsing & arithmetic

Parse digits with leading zeroes as decimal

Bash Scripts: The 10# prefix avoids Bash treating a leading zero as an octal notation.

Bash Scripts✓ Tested
PowerShellText & data

Parse JSON into an object

Access a named field in a JSON document.

JSON✓ Tested