Closed bakkot closed 2 years ago
This outputs just "x"
.
Clarified this to say the newline is "removed" instead of "ignored".
hmm, i'm not sure if that's desired behavior. The presence or absence of trailing newlines matter, especially for file contents (altho all files should always have trailing newlines, sometimes they don't, on purpose)
You can add leading and trailing newlines, but the opening and closing lines are removed. Only "content lines" remain, which may be empty:
String.dedent`
··Lines before and after remain in the output.
`;
^
^
^Lines before and after remain in the output.
^
^
(Using ^
to represent a line, ·
to represent leading whitespace)
ah i guess in the literal form that's fine, because i know where i put a newline
Consider
What string does that end up being? Is it
"x"
or"x\n"
? (Or I guess `"\nx\n"?)The readme says "The closing line's preceding literal newline char is ignored." but I'm not sure what "ignored" means.