Results for “Text cleanup & matching”
Small, practical examples. Search by task or narrow things down below.
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
Read a JSON file
Load a JSON document from disk into Python objects using an explicitly selected text encoding.
json✓ Tested
Read a small INI configuration
Python: Use ConfigParser typed accessors for configuration values stored as text.
Python✓ Tested
Read a UTF-8 file
Read a small file as text using Node.js.
JavaScript✓ Tested
Remove a known prefix with a shell pattern
Bash Scripts: The hash expansion removes the shortest matching prefix without changing the original variable.
Bash Scripts✓ Tested
Replace every occurrence in a string
Substitute text directly with Bash parameter expansion.
replace✓ Tested
Replace repeated whitespace
Normalize runs of whitespace to one space.
regex✓ Tested
Reuse colors with custom properties
Define a CSS custom property and use it for text color.
CSS✓ Tested
Round a decimal with an explicit rule
Java: Construct BigDecimal from text to avoid importing a binary floating-point approximation.
Java✓ Tested
Run a command in a running container
Execute an additional process inside an existing container.
exec✓ Tested