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