chickadee » srfi-130 » string-trim-both

string-trimprocedure
string-trim-rightprocedure
string-trim-bothprocedure

Trim s by skipping over all characters on the left / on the right / on both sides that satisfy the second parameter pred. pred defaults to char-whitespace?.

If no trimming occurs, these functions may return either s or a copy of s; in some implementations, proper substrings may share memory with s.

(string-trim-both "  The outlook wasn't brilliant,  \n\r")
    => "The outlook wasn't brilliant,"