FIND YOUR NEXT FEW LINES

Results for “New-Item”

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

210 snippets foundClear filters
Linux CommandsFiles & permissions

Rename a file with mv

Linux Commands: Rename a known file in the current directory and inspect its new contents.

Linux Commands✓ Tested
GitBranches & ancestry

Rename the current branch

Git: branch -m changes the local branch name without creating a new commit.

Git✓ Tested
Bash ScriptsFiles & reliability

Replace a text file with an atomic rename

Prepare new content beside the target before renaming it into place.

atomic write✓ Tested
JavaScriptArray restructuring

Replace an array segment in place

JavaScript: splice returns removed items and inserts replacements at the chosen position.

JavaScript✓ Tested
TypeScriptArray restructuring

Replace an array segment in place

TypeScript: splice returns removed items and inserts replacements at the chosen position.

TypeScript✓ Tested
C#Strings

Replace literal text

Replace every literal occurrence in a C# string.

C#✓ Tested
PythonStrings & dates

Replace text in a string

Replace every occurrence of a substring and keep the result in a new string. The original string is unchanged.

string✓ Tested
HTMLTables & list numbering

Represent a hierarchy with nested lists

HTML: Place the nested list inside its parent list item to preserve the hierarchy.

HTML✓ Tested
CArray transformations

Rotate a nonempty array left by one element

C: Save the first item before shifting the remaining elements.

C✓ Tested
SQLSelect & filter

Select specific columns

Read only the fields a result needs.

SELECT✓ Tested
C#Data & dates

Serialize an object to JSON

Serialize a small anonymous C# object with System.Text.Json.

C#✓ Tested
C#Collections

Sort values with LINQ

Create an ascending sequence from C# integer values.

C#✓ Tested