Results for “sub”
Small, practical examples. Search by task or narrow things down below.
Inspect a substring without allocating a copy
C++: A string_view refers to existing storage and must not outlive that storage.
C++✓ Tested
Isolate variable changes in a subshell
Bash Scripts: Parentheses create a subshell whose variable assignments do not change the parent.
Bash Scripts✓ Tested
Keep a secondary button from submitting a form
Keep a secondary button from submitting a form with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Keep an action button from submitting a form
HTML: Specify type button for controls whose purpose is a local action.
HTML✓ Tested
Keep loop state by avoiding a pipeline subshell
Bash Scripts: Redirect input into a while loop so updates to a counter remain in the current shell.
Bash Scripts✓ Tested
Observe command substitution’s trailing-newline removal
Bash Scripts: Command substitution removes trailing newlines while preserving embedded ones.
Bash Scripts✓ Tested
Publish updated state through a BehaviorSubject
Publish updated state through a BehaviorSubject with a standalone Angular component and explicit browser behavior.
Angular✓ Tested
Read commit subjects affecting one file
Git: Place the path after -- so Git limits history to the selected file.
Git✓ Tested
Read commit subjects from oldest to newest
Git: Reverse the normal newest-first history order.
Git✓ Tested
Replace a literal substring
SQL: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQL✓ Tested
Replace a literal substring
SQL Server: REPLACE performs a literal replacement rather than a regular-expression substitution.
SQL Server✓ Tested
Replace a literal substring
Postgres: REPLACE performs a literal replacement rather than a regular-expression substitution.
Postgres✓ Tested