Results for “prefix”
Small, practical examples. Search by task or narrow things down below.
Match a text prefix
SQL Server: Use a percent wildcard after a known prefix.
SQL Server✓ Tested
Match a text prefix
Postgres: Use a percent wildcard after a known prefix.
Postgres✓ Tested
Match a text prefix
SQLite: Use a percent wildcard after a known prefix.
SQLite✓ Tested
Read a byte prefix
Linux Commands: Use GNU head -c for a fixed number of bytes, independent of line boundaries.
Linux Commands✓ Tested
Read a fixed-size stream prefix
Read a fixed-size stream prefix using a complete Go program with explicit sample inputs.
Go✓ 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
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
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
Remove an optional prefix
Remove an optional prefix using a complete Go program with explicit sample inputs.
Go✓ Tested
Sort only the smallest requested prefix
C++: partial_sort orders the selected prefix without guaranteeing the order of the remainder.
C++✓ Tested
Calculate a cumulative sum for each position
C: Keep a running total and store each prefix result in a separate output array.
C✓ Tested
Read the beginning of a text value
Python: Extract or display the first three ASCII characters from a known nonempty string.
Python✓ Tested