Peter Alexander:

> Doesn't strip work?
> 
> auto s = strip("
> line 1
> line 2
> line 3
> ");

strip works, maybe even at compile-time for enum string literals.
With it you have to be a bit careful because if later you want to add leading 
spaces to the first line, they get removed.

The slash is used to not break the lines in the middle of the string too (this 
is a less common need):
string s = "verylongstring\
bar";

Bye,
bearophile

Reply via email to