FIND YOUR NEXT FEW LINES

Results for “Strings & text”

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

474 snippets foundClear filters
SQLiteText cleanup & matching

Place missing values after known values portably

SQLite: A CASE sort key controls NULL placement without relying on engine-specific defaults.

SQLite✓ Tested
Linux CommandsTransforming text

Print a selected range of lines

Linux Commands: Use sed -n with a line address to suppress other output.

Linux Commands✓ Tested
Linux CommandsSearching text

Print only the matching portions

Linux Commands: Use extended regex and -o to extract digit sequences.

Linux Commands✓ Tested
Linux CommandsTransforming text

Print the final lines of a file

Linux Commands: Use tail -n for a fixed-size suffix of a log.

Linux Commands✓ Tested
JavaText validation & formatting

Process the lines of an in-memory string

Java: Use String.lines to handle common line terminators without retaining them.

Java✓ Tested
ReactContext & shared state

Provide read-only application configuration

Provide read-only application configuration with a small React component and explicit browser behavior.

React✓ Tested
C#Text validation & encoding

Quote a literal search term for a regex

C#: Regex.Escape prevents metacharacters in a literal term from changing the pattern.

C#✓ Tested
C++Text validation & parsing

Read a quoted string containing spaces

C++: The quoted manipulator extracts a quoted field without splitting at internal spaces.

C++✓ Tested
Bash ScriptsText parsing & arithmetic

Read fields captured by a Bash regular expression

Bash Scripts: BASH_REMATCH contains the full match followed by capture groups after a successful regex test.

Bash Scripts✓ Tested
PowerShellCommands & execution context

Read named fields from a successful regex match

PowerShell: The Matches table is updated after a successful scalar match operation.

PowerShell✓ Tested
PowerShellCommands & execution context

Read the kind of command being invoked

PowerShell: CommandType distinguishes cmdlets from functions, aliases, and external applications.

PowerShell✓ Tested
Arduino / CText & bounded buffers

Reject an integer with trailing characters

Arduino / C: strtol exposes an end pointer so a parser can require the entire token.

Arduino / C✓ Tested