Skip to content

StringTrim

StringTrim(s)

returns a version of s with whitespace removed from start and end.

StringTrim(s, patt)

returns a version of s with strings matching patt removed from start and end.

Examples

>> StringJoin("a", StringTrim(" \\tb\\n "), "c")
abc
>> StringTrim("ababaxababyaabab", RegularExpression("(ab)+"))
axababya

StringCases, StringContainsQ, StringCount, StringExpression, StringFreeQ, StringInsert, StringJoin, StringLength, StringMatchQ, StringPart, StringPosition, StringQ, StringReplace, StringRiffle, StringSplit, StringTake, StringToByteArray

Implementation status

  • ✅ - full supported

Github