Results for “Strings & text”
Small, practical examples. Search by task or narrow things down below.
Fade an entire element and its descendants
CSS: Opacity applies to the rendered element as a group, including child text.
CSS✓ Tested
Find a substring
Check the result of std::string::find against npos.
C++✓ Tested
Find a substring
Use strstr to find a literal substring in a C string.
C✓ Tested
Find commits by message
Search commit subjects and bodies for a phrase.
log✓ Tested
Find the final day of a month
Use EOMONTH without manually calculating month length.
EOMONTH✓ Tested
Format a date without locale ambiguity
Parse an ISO date and format it consistently.
date✓ Tested
Format a timestamp
Extract a year and month from ISO timestamp text.
strftime✓ Tested
Generate numbers with a recursive CTE
Build a bounded sequence using SQL recursion.
recursive CTE✓ Tested
Handle a button click
Attach a jQuery click handler to update text.
jQuery✓ Tested
Inspect a parsed URI
C#: Use Uri properties instead of splitting URL strings manually.
C#✓ Tested
Join transformed stream values
Java: Use Collectors.joining after converting elements to strings.
Java✓ Tested
Keep a decorative icon out of a button’s name
HTML: aria-hidden excludes a decorative character while leaving the visible action text as the accessible name.
HTML✓ Tested