PowerShell: String
String is a sequence of characters. There are 3 syntax to create string.
'singe quoted string'
"double quoted string"
[see PowerShell: String Expansion]- Here-String
Single Quoted, Literal String
- Character sequence between APOSTROPHE
'single quote'
is literal string. - Can contain multiple lines.
- To include a single quote inside single quoted string, use two single quotes.
- Backslash is literal, GRAVE ACCENT
`
also literal.
$x = 'some thing' echo $x
To include a single quote inside single quoted string, use two single quotes.
# double single quote becomes a single quote $x = 'don''t' $x -eq "don't"
# backslash is literal, GRAVE ACCENT also literal $x = 'a\n`nb'