PowerShell: APOSTROPHE Quoted String (verbatim)
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,
$1in single quoted string means capture still. - PowerShell: Regular Expression Operators
PowerShell, string and regular expression
- PowerShell: String
- PowerShell: APOSTROPHE Quoted String (verbatim)
- PowerShell: QUOTATION MARK Quoted String (Expandable)
- PowerShell: Here-String (block quote for big text)
- PowerShell: String Escape Sequences
- 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