Results for “Text parsing & arithmetic”
Small, practical examples. Search by task or narrow things down below.
Map an input range to an output range
Scale an integer reading to a different interval.
map✓ Tested
Narrow a union using typeof
Handle text and numeric values with separate branches.
union✓ Tested
Number a sorted result
Assign a row number without changing stored data.
row_number✓ Tested
Number rows within each group
Assign ordered row numbers with a window function.
row_number✓ Tested
Open a link in a separate tab
Declare a separate browsing context with an explicit noopener relationship.
HTML✓ Tested
Pad a numeric label
Convert a number to text and pad it to a fixed width.
JavaScript✓ Tested
Parse an integer with validation
Validate range and trailing characters when parsing a C integer with strtol.
C✓ Tested
Parse JSON into an object
Access a named field in a JSON document.
JSON✓ Tested
Preserve whitespace while wrapping
Use CSS pre-wrap for multiline text that retains spaces.
CSS✓ Tested
Print a label beside a number
Arduino / C: Combine Serial.print and Serial.println to put text and a value on one line.
Arduino / C✓ Tested
Read a data attribute
Read an element data attribute with jQuery data.
jQuery✓ Tested
Read a file line by line
Read C++ text lines without loading the whole file at once.
C++✓ Tested