FIND YOUR NEXT FEW LINES

Results for “C++”

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

3000 snippets foundClear filters
SQL ServerSchema design & transactions

Read updated base-table values through a view

SQL Server: An ordinary view reflects later changes to its underlying data.

SQL Server✓ Tested
PostgresSchema design & transactions

Read updated base-table values through a view

Postgres: An ordinary view reflects later changes to its underlying data.

Postgres✓ Tested
SQLiteSchema design & transactions

Read updated base-table values through a view

SQLite: An ordinary view reflects later changes to its underlying data.

SQLite✓ 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
PythonText validation & encoding

Remove a known suffix safely

Python: Use removesuffix to remove only a matching ending.

Python✓ Tested
AngularLists & control flow

Remove a list item by identifier

Remove a list item by identifier with a standalone Angular component and explicit browser behavior.

Angular✓ Tested
CStrings

Remove a trailing line ending

Use strcspn to terminate a C string at its first newline or carriage return.

C✓ Tested
Linux CommandsFiles & permissions

Remove an empty directory only

Linux Commands: Use rmdir so a directory containing files cannot be removed accidentally.

Linux Commands✓ Tested
ReactState & reducers

Remove an item with filter

Remove an item with filter with a small React component and explicit browser behavior.

React✓ Tested
PowerShellHashtables & object records

Remove an optional hashtable entry

PowerShell: Remove changes the map in place without changing unrelated entries.

PowerShell✓ Tested
C++Collections

Remove odd values

Use the erase-remove idiom to filter a C++ vector in place.

C++✓ Tested