FIND YOUR NEXT FEW LINES

Results for “literal”

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

80 snippets foundClear filters
PowerShellStrings & literal text

Join several strings with a separator

PowerShell: The join operator returns one string from an input collection.

PowerShell✓ Tested
PowerShellStrings & literal text

Pad a label with leading zeroes

PowerShell: Use a numeric format specifier to control the displayed width.

PowerShell✓ Tested
Bash ScriptsDiagnostics & defensive scripting

Prevent a variable value from expanding as a filename pattern

Bash Scripts: Quote a variable to pass its literal contents even when matching filenames exist.

Bash Scripts✓ Tested
Linux CommandsGetting Started

Prevent expansion with single quotes

Linux Commands: Prevent expansion with single quotes using GNU/Linux commands in an empty practice directory.

Linux Commands✓ Tested
PowerShellStrings & literal text

Split text on a simple delimiter

PowerShell: The split operator uses a regular expression; this delimiter has no special regex meaning.

PowerShell✓ Tested
PowerShellStrings & literal text

Trim whitespace around a string

PowerShell: The Trim method removes surrounding whitespace while preserving the middle of the string.

PowerShell✓ Tested
PowerShellStrings & literal text

Write a multiline string without expanding variables

PowerShell: A single-quoted here-string preserves dollar signs literally.

PowerShell✓ Tested
PostgresDates & series

Add an interval to a date

Perform calendar arithmetic with an interval literal.

INTERVAL✓ Tested
CDynamic memory & ownership

Allocate and initialize a structure

C: Use a compound literal assignment to initialize all ordinary structure fields.

C✓ Tested
JavaText validation & formatting

Check a filename suffix

Java: Use endsWith for a case-sensitive literal suffix test.

Java✓ Tested
JavaText validation & formatting

Check a string prefix

Java: Use startsWith to check a literal Java prefix without a regular expression.

Java✓ Tested
Bash ScriptsArray operations

Check exact array membership

Bash Scripts: Compare each element literally instead of searching a concatenated string.

Bash Scripts✓ Tested