From Kx Wiki
trim (trim function)
trim removes any leading and trailing spaces from a string.
q)trim" IBM " "IBM"
Note that when converting a string to a symbol, leading and trailing blanks are automatically trimmed:
`$" IBM " `IBM
For a complete list of functions, see the kdb+ Function Reference.