string_l/r/trim


string_trim(s)
string_ltrim(s)
string_rtrim(s)
      

Return a new copy of the string s with white-spaces removed from its left (ltrim), right (rtrim) or both left and right (trim).

Examples:


let s = "  hello "
showln("##", s, "##")
//> ##  hello ##
showln("##", string_ltrim(s), "##")
//> ##hello ##
showln("##", string_rtrim(s), "##")
//> ##  hello##
showln("##", string_trim(s), "##")
//> ##hello##
      

Also see:

make_string
string_copy
char_is_whitespace


Core Module Index | Contents