FIND YOUR NEXT FEW LINES

The snippet library.

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

3000 snippets foundClear filters
JavaFile operations & binary data

Delete a known temporary file if present

Java: deleteIfExists returns whether a file was removed and still reports other I/O errors.

Java✓ Tested
GoMaps & sets

Delete a map entry

Delete a map entry using a complete Go program with explicit sample inputs.

Go✓ Tested
GitBranches & ancestry

Delete an already merged practice branch

Git: The lowercase -d option refuses to delete an unmerged branch in ordinary use.

Git✓ Tested
C++Filesystem operations

Delete one known scratch file

C++: filesystem::remove reports whether an item was removed and also supports empty directories.

C++✓ Tested
SQLChange & combine data

Delete one matching row

Remove a selected record and inspect what remains.

DELETE✓ Tested
SQLGetting Started

Delete one row from a practice table

SQL: Restrict DELETE with a primary-key condition and verify the remaining row count.

SQL✓ Tested
SQL ServerGetting Started

Delete one row from a practice table

SQL Server: Restrict DELETE with a primary-key condition and verify the remaining row count.

SQL Server✓ Tested
PostgresGetting Started

Delete one row from a practice table

Postgres: Restrict DELETE with a primary-key condition and verify the remaining row count.

Postgres✓ Tested
SQLiteGetting Started

Delete one row from a practice table

SQLite: Restrict DELETE with a primary-key condition and verify the remaining row count.

SQLite✓ Tested
PowerShellFile operations & integrity

Delete only a named scratch file

PowerShell: Use LiteralPath and avoid recursive removal for a single known file.

PowerShell✓ Tested
GitTags & repository configuration

Delete only a selected local tag

Git: Deleting a local tag does not delete a corresponding remote tag.

Git✓ Tested
SQLBulk changes & set operations

Delete rows selected by a related table

SQL: A correlated EXISTS limits the delete to explicitly listed records.

SQL✓ Tested