Results for “Strings & literal text”
Small, practical examples. Search by task or narrow things down below.
Replace literal text
Replace literal text using a complete Go program with explicit sample inputs.
Go✓ Tested
Join several strings with a separator
PowerShell: The join operator returns one string from an input collection.
PowerShell✓ Tested
Split text on a simple delimiter
PowerShell: The split operator uses a regular expression; this delimiter has no special regex meaning.
PowerShell✓ Tested
Use a literal value in a regular expression
PowerShell: Regex.Escape prevents a literal dot or other metacharacter from changing the match.
PowerShell✓ Tested
Replace literal text
Replace every literal occurrence in a C# string.
C#✓ Tested
Replace literal text
Replace all literal matches in a Java string without regular expressions.
Java✓ Tested
Check a string prefix using ordinal comparison
PowerShell: Supply an explicit comparison rule for protocol identifiers.
PowerShell✓ Tested
Check a suffix without case sensitivity
PowerShell: Use an ordinal case-insensitive comparison for a known filename extension.
PowerShell✓ Tested
Extract a known substring
PowerShell: Substring uses a zero-based starting index and a character count.
PowerShell✓ Tested
Insert values into a multiline template
PowerShell: A double-quoted here-string expands variable references.
PowerShell✓ Tested
Pad a label with leading zeroes
PowerShell: Use a numeric format specifier to control the displayed width.
PowerShell✓ Tested
Trim whitespace around a string
PowerShell: The Trim method removes surrounding whitespace while preserving the middle of the string.
PowerShell✓ Tested