FIND YOUR NEXT FEW LINES

Results for “prefix”

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

46 snippets foundClear filters
SQL ServerGetting Started

Match a text prefix

SQL Server: Use a percent wildcard after a known prefix.

SQL Server✓ Tested
PostgresGetting Started

Match a text prefix

Postgres: Use a percent wildcard after a known prefix.

Postgres✓ Tested
SQLiteGetting Started

Match a text prefix

SQLite: Use a percent wildcard after a known prefix.

SQLite✓ Tested
Linux CommandsStreams & byte tools

Read a byte prefix

Linux Commands: Use GNU head -c for a fixed number of bytes, independent of line boundaries.

Linux Commands✓ Tested
GoTesting & reusable helpers

Read a fixed-size stream prefix

Read a fixed-size stream prefix using a complete Go program with explicit sample inputs.

Go✓ 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
Bash ScriptsParameter expansion

Remove a known prefix with a shell pattern

Bash Scripts: The hash expansion removes the shortest matching prefix without changing the original variable.

Bash Scripts✓ Tested
RustStrings & Unicode

Remove a prefix only when it matches

Remove a prefix only when it matches in a complete Rust program using the standard library.

Rust✓ Tested
GoStrings & text

Remove an optional prefix

Remove an optional prefix using a complete Go program with explicit sample inputs.

Go✓ Tested
C++Ordering & set operations

Sort only the smallest requested prefix

C++: partial_sort orders the selected prefix without guaranteeing the order of the remainder.

C++✓ Tested
CArray transformations

Calculate a cumulative sum for each position

C: Keep a running total and store each prefix result in a separate output array.

C✓ Tested
PythonGetting Started

Read the beginning of a text value

Python: Extract or display the first three ASCII characters from a known nonempty string.

Python✓ Tested