The trim() function removes whitespaces (' ', '\t', '\r', '\n') from the beginning and end of a string.
trim(expr)
trim(' gwc ')
produces
'gwc'