PowerShell: Single Quoted String
Single Quoted (Verbatim String)
Character sequence between APOSTROPHE '
is verbatim string.
- Can contain multiple lines.
- Backslash is literal, GRAVE ACCENT
`
also literal.
$x = 'some thing' Write-Host $x
How to Embed a APOSTROPHE
To include a APOSTROPHE inside APOSTROPHE quoted string, use two APOSTROPHE.
'don''t' # don't
- 🛑 WARNING:
- in argument of regex replacement operator,
$1
in single quoted string means capture still. - PowerShell: Regular Expression Operators
PowerShell, string and regular expression
- PowerShell: String
- PowerShell: Single Quoted String
- PowerShell: Double Quoted String
- PowerShell: Here-String
- PowerShell: Escape Characters
- PowerShell: String Length
- PowerShell: Join String
- PowerShell: Split String
- PowerShell: Format String
- PowerShell: String Methods
- PowerShell: String Wildcards
- PowerShell: Regular Expression Operators
- PowerShell: Regex Result ($Matches)
- PowerShell: Regular Expression Syntax