StringChomp[str] chops initial and final white space of the string str.
StringChomp[str]
str
Overview, Write2.
StringChomp[" abc "] % // InputForm
abc\text{abc}abc
"abc"