It's also worth knowing that you can use subseq as a substring function:
arc> (let val "foox" (subseq val 0 (- (len val) 1))) "foo"