The passed line without any preceding passed characters.
{ immutable trailing = ",abc"; immutable stripped = trailing.strippedLeft(','); assert((stripped == "abc"), stripped); } { immutable trailing = "!!!abc"; immutable stripped = trailing.strippedLeft('!'); assert((stripped == "abc"), stripped); } { immutable trailing = "abc"; immutable stripped = trailing.strippedLeft(' '); assert((stripped == "abc"), stripped); } { immutable trailing = ""; immutable stripped = trailing.strippedLeft(' '); assert(!stripped.length, stripped); } { immutable trailing = ",abc"; immutable stripped = trailing.strippedLeft(","); assert((stripped == "abc"), stripped); } { immutable trailing = "!!!abc"; immutable stripped = trailing.strippedLeft(",1!"); assert((stripped == "abc"), stripped); } { immutable trailing = "abc"; immutable stripped = trailing.strippedLeft(" "); assert((stripped == "abc"), stripped); } { immutable trailing = ""; immutable stripped = trailing.strippedLeft(" "); assert(!stripped.length, stripped); }
Returns a slice of the passed string with any preceding passed characters sliced off. Implementation capable of handling both individual characters and strings of tokens to strip.
Duplicates std.string.stripLeft, which we can no longer trust not to assert on unexpected input.