trim, ltrim, rtrim

Remove leading or trailing spaces from a string

trim

Trim leading and trailing spaces

Syntax: trim x, trim[x]

Returns string x with any leading or trailing spaces removed.

q)trim"   IBM   "
"IBM"

ltrim

Trim leading spaces

Syntax: ltrim x, ltrim[x]

Left trim: returns string x with any leading space/s removed.

q)ltrim"   IBM   "
"IBM   "

rtrim

Trim trailing spaces

Syntax: rtrim x, rtrim[x]

Right trim: returns string x with any trailing space/s removed.

q)rtrim"   IBM   "
"   IBM"

_ Drop
Basics: Strings