A here-string cannot contain blank line - by Dardenne Laurent

Status : 

 


8
0
Sign in
to vote
ID 571644 Comments
Status Active Workarounds
Type Bug Repros 5
Opened 6/29/2010 6:04:28 AM
Access Restriction Public

Description

In a here-string, the blank line are removed.

The end of line (LF) in a here-string, is not equal to System.Environment.NewLine(CR+LF). 
Sign in to post a comment.
Posted by jrich on 9/8/2010 at 7:17 AM
Oddly enough, This works as expected in ISE but not the console.
Posted by Michael_B_Smith on 8/25/2010 at 8:07 AM
This is true in interactive shell mode. When a line continuation character is displayed (">>"), if an empty line (or a line containing all spaces -- I presume it's actually a line containing all whitespace, but I didn't test) is entered, then the shell "swallows" the line. So...

$s = @'
aa

bb

cc
'@

is actually stored as

$s = @'
aa
bb
cc
'@

This error exists for both single and double quoted here-strings.

When executing a script file, this does not occur.