string or random access range of characters
slice of str stripped of trailing whitespace or characters specified in the second argument.
import std.uni : lineSep, paraSep; assert(stripRight(" hello world ") == " hello world"); assert(stripRight("\n\t\v\rhello world\n\t\v\r") == "\n\t\v\rhello world"); assert(stripRight("hello world") == "hello world"); assert(stripRight([lineSep] ~ "hello world" ~ lineSep) == [lineSep] ~ "hello world"); assert(stripRight([paraSep] ~ "hello world" ~ paraSep) == [paraSep] ~ "hello world");
Generic stripping on ranges: std.algorithm.mutation._stripRight
Strips trailing whitespace (as defined by std.uni.isWhite) or as specified in the second argument.