Results for “literal”
Small, practical examples. Search by task or narrow things down below.
Delete only a named scratch file
PowerShell: Use LiteralPath and avoid recursive removal for a single known file.
PowerShell✓ Tested
Find a commit that changed the count of a text string
Git: The pickaxe -S option finds commits that add or remove occurrences of a literal string.
Git✓ 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
Format a timestamp
Extract a year and month from ISO timestamp text.
strftime✓ Tested
Handle a filename pattern with no matches
Use nullglob so an unmatched pattern produces an empty array.
nullglob✓ Tested
Handle a result with a discriminated union
Separate success data from an error message.
discriminated union✓ Tested
Keep a serial message in flash memory
Arduino / C: The F macro keeps a literal out of scarce SRAM.
Arduino / C✓ Tested
Match any pattern from a file
Linux Commands: Use grep -F -f with one literal pattern per line.
Linux Commands✓ Tested
Match one of several values
Use IN to avoid repeating equality conditions.
IN✓ Tested
Read a whole text file
Load text as one string instead of one item per line.
Get-Content✓ Tested
Remove a known prefix safely
Python: Use removeprefix instead of lstrip when removing a literal prefix rather than a set of characters.
Python✓ Tested