Strings.trim3kaya
Trim selected characters from both ends of a string
Usage
Void trim( var String x, Bool(Char) fn=isSpace )
Arguments
x The string to trim
fn The trimming function. Returns true if characters should be trimmed, false otherwise. The default function is Prelude.isSpace (3kaya) which trims whitespace.
Overview
Remove characters in-place from both ends of a String as determined by the trimming function.
-
str = " this string needs trimming ";
trim(str);
// str = "this string needs trimming";
Releases
4 releases since Debian 5.0 (Lenny); the text changed 3 times.