Line to strip both the right and left side of.
The passed line, stripped of surrounding whitespace.
static if (!is(typeof("blah".stripped) == string)) { enum message = "`lu.string.stripped` should return a mutable string"; static assert(0, message); } { immutable line = " abc "; immutable stripped_ = line.stripped; assert((stripped_ == "abc"), stripped_); } { immutable line = " "; immutable stripped_ = line.stripped; assert((stripped_ == ""), stripped_); } { immutable line = ""; immutable stripped_ = line.stripped; assert((stripped_ == ""), stripped_); } { immutable line = "abc"; immutable stripped_ = line.stripped; assert((stripped_ == "abc"), stripped_); } { immutable line = " \r\n abc\r\n\r\n"; immutable stripped_ = line.stripped; assert((stripped_ == "abc"), stripped_); }
Returns a slice of the passed string with any preceding or trailing whitespace or linebreaks sliced off both ends. Overload that implicitly strips " \n\r\t".
It merely calls both strippedLeft and strippedRight. As such it duplicates std.string.strip, which we can no longer trust not to assert on unexpected input.