Results for “Strings & text”
Small, practical examples. Search by task or narrow things down below.
Limit a numeric input to an inclusive range
HTML: Number inputs expose range validation separately from the entered text.
HTML✓ Tested
List matching files
Enumerate immediate text files and sort their names in C#.
C#✓ Tested
Measure a string length
Count bytes before the null terminator with C strlen.
C✓ 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
Parse and format a date
Convert a date string into a datetime object, then format it in a different, human-readable order.
date✓ 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