To avoid a newline in multi-line strings

Peter Alexander peter.alexander.au at gmail.com
Sat Jul 23 10:09:40 PDT 2011


On 23/07/11 5:10 PM, bearophile wrote:
> Andrej Mitrovic:
>
>> import std.algorithm;
>> [snip]
>
> Thank you for your code, but I think this code will not be added to Phobos, and even if so, I don't think lot of people will want to use it.
>
> Bye,
> bearophile

Doesn't strip work?

auto s = strip("
line 1
line 2
line 3
");

http://d-programming-language.org/phobos/std_string.html#strip

 > Strips both leading and trailing whitespace.


More information about the Digitalmars-d mailing list