![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | How to represent newline as a character constant? How do I represent a newline character as a character constant suitable for inclusion in a Char array? In C, I would use "\n" to represent a character array containing a single newline character. How would I do this in PowerShell? TIA Chris |
My System Specs![]() |
| | #2 (permalink) |
| | Re: How to represent newline as a character constant? "Christopher Bootland" <bootland@xxxxxx> wrote in message news:13r5213kmtbmm45@xxxxxx Quote: > How do I represent a newline character as a character constant suitable > for inclusion in a Char array? > > In C, I would use "\n" to represent a character array containing a single > newline character. How would I do this in PowerShell? > The escape character in PowerShell is a backtick instead of a backslash. That way you can use backslashes in file paths without having to escape them. Watch out though. If you used C style single quotes (like you would for a char in C) that defeats the escape mechansim e.g.: 14> '`n' `n 15> "`n" 16> -- Keith |
My System Specs![]() |
| | #3 (permalink) |
| | Re: How to represent newline as a character constant? "Christopher Bootland" <bootland@xxxxxx> wrote in message news:13r5213kmtbmm45@xxxxxx Quote: > How do I represent a newline character as a character constant suitable > for inclusion in a Char array? > > In C, I would use "\n" to represent a character array containing a single > newline character. How would I do this in PowerShell? > > TIA > Chris > Some more possibilties [char]13 #Carriage return [char]10 #Line feed [[char]13 + [char]10 #Combination of the 2 -- Jon |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Re: NewLine bug of Windows Speech Recognition revisited | Vista General | |||
| represent XML in classes/collections (C#) | .NET General | |||
| Remove Newline from String | PowerShell | |||
| NewLine in PoSh | PowerShell | |||
| Problem with [environment]::NewLine and Regular Expression | PowerShell | |||