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