Results for “cast”
Small, practical examples. Search by task or narrow things down below.
Convert text without raising a conversion error
Return NULL when a numeric conversion fails.
TRY_CONVERT✓ Tested
Add an interval to a date
Perform calendar arithmetic with an interval literal.
INTERVAL✓ Tested
Assemble a big-endian 16-bit value
Arduino / C: Cast to an unsigned 16-bit type before shifting the high byte.
Arduino / C✓ Tested
Calculate whole days between dates
Subtract Julian day values for date-only inputs.
julianday✓ Tested
Convert a duration to another unit explicitly
C++: duration_cast converts units and truncates fractional integer units.
C++✓ Tested
Convert ASCII text to lowercase safely
C++: Cast each byte to unsigned char before using the cctype function.
C++✓ Tested
Convert ASCII text to lowercase safely
C: Cast to unsigned char before calling ctype functions on a possibly signed char.
C✓ Tested
Extract part of a date
Read a calendar component with EXTRACT.
EXTRACT✓ Tested
Narrow an object with a pattern variable
Java: Pattern matching avoids a separate cast after a successful instanceof check.
Java✓ Tested
Read rows from CSV text
Parse CSV into objects with named properties.
CSV✓ Tested