FIND YOUR NEXT FEW LINES

Results for “literal”

Small, practical examples. Search by task or narrow things down below.

80 snippets foundClear filters
PowerShellFile operations & integrity

Delete only a named scratch file

PowerShell: Use LiteralPath and avoid recursive removal for a single known file.

PowerShell✓ Tested
GitCommit history & revision selection

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
CStrings

Find a substring

Use strstr to find a literal substring in a C string.

C✓ Tested
GitCommits & history

Find commits by message

Search commit subjects and bodies for a phrase.

log✓ Tested
SQLiteDates & time

Format a timestamp

Extract a year and month from ISO timestamp text.

strftime✓ Tested
Bash ScriptsFiles & reliability

Handle a filename pattern with no matches

Use nullglob so an unmatched pattern produces an empty array.

nullglob✓ Tested
TypeScriptSafe data handling

Handle a result with a discriminated union

Separate success data from an error message.

discriminated union✓ Tested
Arduino / CText & bounded buffers

Keep a serial message in flash memory

Arduino / C: The F macro keeps a literal out of scarce SRAM.

Arduino / C✓ Tested
Linux CommandsSearching text

Match any pattern from a file

Linux Commands: Use grep -F -f with one literal pattern per line.

Linux Commands✓ Tested
SQLSelect & filter

Match one of several values

Use IN to avoid repeating equality conditions.

IN✓ Tested
PowerShellFiles & paths

Read a whole text file

Load text as one string instead of one item per line.

Get-Content✓ Tested
PythonText validation & encoding

Remove a known prefix safely

Python: Use removeprefix instead of lstrip when removing a literal prefix rather than a set of characters.

Python✓ Tested