StringTrim
StringTrim["string"] trims whitespace from the beginning and end of the string.
StringTrim["string", patt] trims substrings matching patt.
Examples
Trim whitespace:
StringTrim[" Hello World "]
(* "Hello World" *)Trim specific characters:
StringTrim["###hello###", "#" ..]
(* "hello" *)Please visit the official Wolfram Language Reference for more details.