Skip to content

StringTrim

Removes leading and trailing whitespace.

$ wo 'StringTrim["  hello  "]'
hello
$ wo 'StringTrim["  hello world  "]'
hello world

With a pattern, removes leading and trailing occurrences:

$ wo 'StringTrim["xxhelloxx", "xx"]'
hello