This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

StringTrim

StringTrim
trims whitespace from the beginning and end of .
StringTrim
trims substrings matching patt from the beginning and end.
  • Whitespace is taken to include any number of spaces, tabs, and newlines.
  • StringTrim gives the list of results for each of the .
Remove whitespace from ends of strings:
Remove multiple character types:
Remove initial space characters using a regular expression pattern:
Remove whitespace from ends of strings:
In[1]:=
Click for copyable input
Out[1]//FullForm=
 
Remove multiple character types:
In[1]:=
Click for copyable input
Out[1]//FullForm=
 
Remove initial space characters using a regular expression pattern:
In[1]:=
Click for copyable input
Out[1]//FullForm=
New in 7