Place Special Characters in a String in PowerShell
Problem
You want to place special characters (such as tab and newline) in a string variable.
Solution
In an expanding string, use PowerShell’s escape sequences to include special characters such as tab and newline.
PS >$myString = "Report for Today`n" PS >$myString Report for Today
Discussion
Aliteral string uses single quotes around its text, while an expanding string uses double quotes around its text.
- Read more about Place Special Characters in a String in PowerShell
- Log in or register to post comments