| [ Web Proxy ] |
| Viewing: https://riptutorial.com/powershell/example/20568/multiline-string | [Back] [Original] |
[logo rip]
There are multiple ways to create a multiline string in PowerShell:
You can use the special characters for carriage return and/or newline manually or use the NewLine-environment variable to insert the systems "newline" value)
"Hello`r`nWorld"
"Hello{0}World" -f [environment]::NewLine
Create a linebreak while defining a string (before closing quote)
"Hello
World"
Using a here-string. This is the most common technique.
@"
Hello
World
"@
| Web Proxy Viewer | New URL | Original Page |