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
TypeScriptText handling & Unicode

Repeat a string a fixed number of times

TypeScript: String.repeat requires a nonnegative finite repetition count.

TypeScript✓ Tested
Arduino / CText & bounded buffers

Replace a token inside an Arduino String

Arduino / C: replace modifies all occurrences in the existing object.

Arduino / C✓ Tested
PowerShellCommands & execution context

Restore an environment value after temporary use

PowerShell: Use finally so temporary process configuration does not leak to subsequent work; remove the entry when it was originally absent.

PowerShell✓ Tested
PowerShellCommands & execution context

Restore the working location after an operation

PowerShell: Push-Location and Pop-Location manage a directory stack; finally ensures restoration.

PowerShell✓ Tested
SQLiteQueries & text

Search a small FTS5 table

Use SQLite’s full-text index to match a term.

FTS5✓ Tested
ReactRefs & DOM interaction

Select the contents of an input

Select the contents of an input with a small React component and explicit browser behavior.

React✓ Tested
Bash ScriptsText parsing & arithmetic

Set and clear a bit in a shell integer

Bash Scripts: Use shifts and bitwise operators for a small flag field.

Bash Scripts✓ Tested
Linux CommandsSearching text

Show line numbers beside matches

Linux Commands: Use grep -n so a result identifies its position in the source file.

Linux Commands✓ Tested
RustStrings & Unicode

Split a key-value pair once

Split a key-value pair once in a complete Rust program using the standard library.

Rust✓ Tested
Bash ScriptsText parsing & arithmetic

Split a record while retaining its remainder

Bash Scripts: The final read variable receives the remainder of a delimited record.

Bash Scripts✓ Tested
Arduino / CText & bounded buffers

Split a writable comma-delimited buffer

Arduino / C: strtok modifies its buffer and returns successive tokens.

Arduino / C✓ Tested
RustStrings & Unicode

Split on Unicode whitespace

Split on Unicode whitespace in a complete Rust program using the standard library.

Rust✓ Tested