Unindents, strips whitespace-only lines from top and bottom,
and strips trailing whitespace from eash line.
(Also converts Windows "\r\n" line endings to Unix "\n" line endings.)
See also the documentation for unindent().
Good for making easily-readable multi-line string literals without
leaving extra indents and whitespace in the resulting string:
Do this:
voidfoo()
{
enumcodeStr = q{// Written in the D Programming Langauge// by John Doeintmain()
{
return0;
}
}.normalize();
}
Instead of this:
voidfoo()
{
enumcodeStr =
q{// Written in the D Programming Langauge// by John Doeintmain()
{
return0;
}};
}
Unindents, strips whitespace-only lines from top and bottom, and strips trailing whitespace from eash line. (Also converts Windows "\r\n" line endings to Unix "\n" line endings.)
See also the documentation for unindent().
Good for making easily-readable multi-line string literals without leaving extra indents and whitespace in the resulting string:
Do this:
Instead of this:
The resulting string is exactly the same.