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
).
let s = " hello "
showln("##", s, "##")
//> ## hello ##
showln("##", string_ltrim(s), "##")
//> ##hello ##
showln("##", string_rtrim(s), "##")
//> ## hello##
showln("##", string_trim(s), "##")
//> ##hello##