FIND YOUR NEXT FEW LINES

Results for “Strings & text”

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

474 snippets foundClear filters
PowerShellStrings & literal text

Write a multiline string without expanding variables

PowerShell: A single-quoted here-string preserves dollar signs literally.

PowerShell✓ Tested
C#Text validation & encoding

Build text incrementally with StringBuilder

C#: Append fragments instead of repeatedly concatenating intermediate strings in a loop.

C#✓ Tested
JavaStrings

Check whether text contains a phrase

Use a case-sensitive Java substring check.

Java✓ Tested
CStrings

Convert ASCII text to uppercase

Convert characters with toupper while avoiding signed-char undefined behavior.

C✓ Tested
CStrings

Copy text into a fixed buffer

Use snprintf and check for truncation when copying a C string.

C✓ Tested
PythonStrings & dates

Extract numbers from text

Find all runs of ASCII digits in a string and convert the matches to integers.

regex✓ Tested
C#Strings

Find text ignoring case

Use ordinal case-insensitive comparison for a C# substring search.

C#✓ Tested
PowerShellText & data

Read rows from CSV text

Parse CSV into objects with named properties.

CSV✓ Tested
C#Strings

Replace literal text

Replace every literal occurrence in a C# string.

C#✓ Tested
JavaStrings

Replace literal text

Replace all literal matches in a Java string without regular expressions.

Java✓ 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
JavaScriptStrings

Split and trim text

Split simple comma-separated JavaScript text and trim each part.

JavaScript✓ Tested