Results for “Text & bounded buffers”
Small, practical examples. Search by task or narrow things down below.
Split text on several separator characters
JavaScript: A regex character class can recognize alternative simple delimiters.
JavaScript✓ Tested
Split text on several separator characters
TypeScript: A regex character class can recognize alternative simple delimiters.
TypeScript✓ Tested
Store text in a variable
Bash Scripts: Store text in a variable with a small standalone Bash program.
Bash Scripts✓ Tested
Style placeholder text independently of entered text
CSS: The placeholder pseudo-element affects the hint, while the input rule styles the actual value.
CSS✓ Tested
Style supporting text in italics
CSS: Font-style changes presentation without adding semantic emphasis by itself.
CSS✓ Tested
Swap owned buffers by swapping their pointers
C: Pointer swaps avoid copying the underlying data.
C✓ Tested
Treat dynamic regex input as literal text
Java: Use Pattern.quote so metacharacters in a search term lose their special meaning.
Java✓ Tested
Trim whitespace around text
Trim whitespace around text in a complete Rust program using the standard library.
Rust✓ Tested
Underline meaningful text
CSS: Learn how to underline meaningful text in a complete browser example.
CSS✓ Tested
Update state shared through context
Update state shared through context with a small React component and explicit browser behavior.
React✓ Tested
Use a context’s fallback value
Use a context’s fallback value with a small React component and explicit browser behavior.
React✓ Tested
Use a recursive function for a bounded calculation
Bash Scripts: A recursive factorial demonstrates local variables and a clear base case.
Bash Scripts✓ Tested