FIND YOUR NEXT FEW LINES

Results for “Strings & literal text”

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

495 snippets foundClear filters
CStrings & byte buffers

Find the first occurrence of a character

C: strchr returns a pointer into the input or NULL if the character is absent.

C✓ Tested
Bash ScriptsText parsing & arithmetic

Format a numeric label with leading zeroes

Bash Scripts: Use a constant printf format string and supply values as separate arguments.

Bash Scripts✓ Tested
Arduino / CText & bounded buffers

Format several integers in a fixed buffer

Arduino / C: snprintf limits writes to the buffer size and includes a terminating null byte.

Arduino / C✓ Tested
HTMLText semantics

Identify the title of a cited work

HTML: Cite marks the title of a work rather than the name of its author.

HTML✓ Tested
Bash ScriptsText parsing & arithmetic

Increment a counter without an unexpected errexit

Bash Scripts: An assignment avoids the zero-result exit status of a standalone arithmetic post-increment.

Bash Scripts✓ Tested
C++Text validation & parsing

Inspect a substring without allocating a copy

C++: A string_view refers to existing storage and must not outlive that storage.

C++✓ Tested
PowerShellCommands & execution context

Inspect a URI through typed properties

PowerShell: The Uri class separates URL components without manual string splitting.

PowerShell✓ Tested
HTMLText semantics

Isolate a value with a different writing direction

HTML: Bdi isolates embedded user text so its direction does not reorder surrounding punctuation.

HTML✓ Tested
C++Text validation & parsing

Iterate over all regular-expression matches

C++: A regex iterator yields successive matches without manually updating an offset.

C++✓ Tested
Linux CommandsTransforming text

Join lines from two files side by side

Linux Commands: Use paste to pair lines by position with a chosen separator.

Linux Commands✓ Tested
SQL ServerDates & text

Join rows in a chosen order

Aggregate text with STRING_AGG and WITHIN GROUP.

STRING_AGG✓ Tested
RustStrings & Unicode

Join string slices

Join string slices in a complete Rust program using the standard library.

Rust✓ Tested