Results for “none”
Small, practical examples. Search by task or narrow things down below.
Find both extremes in one algorithm call
C++: Check for a nonempty input before dereferencing the returned iterators.
C++✓ Tested
Find the largest array value
Track the maximum in a nonempty C integer array.
C✓ Tested
Read a file without losing its last line
Handle spaces, backslashes, and a final line without a newline.
read lines✓ Tested
Read one JSON document per line
Python: Parse nonempty JSON Lines records independently instead of loading a JSON array.
Python✓ Tested
Read the beginning of a text value
Python: Extract or display the first three ASCII characters from a known nonempty string.
Python✓ Tested
Read the beginning of a text value
C#: Extract or display the first three ASCII characters from a known nonempty string.
C#✓ Tested
Read the beginning of a text value
Java: Extract or display the first three ASCII characters from a known nonempty string.
Java✓ Tested
Read the beginning of a text value
JavaScript: Extract or display the first three ASCII characters from a known nonempty string.
JavaScript✓ Tested
Read the beginning of a text value
TypeScript: Extract or display the first three ASCII characters from a known nonempty string.
TypeScript✓ Tested
Read the beginning of a text value
C++: Extract or display the first three ASCII characters from a known nonempty string.
C++✓ Tested
Read the beginning of a text value
C: Extract or display the first three ASCII characters from a known nonempty string.
C✓ Tested
Read the first collection element
Python: Access index zero only after establishing that the collection is nonempty.
Python✓ Tested