You can create an action around $trim(x,c)
$trim(x,c)
From the documentation:
or you try one of the other FAQ entries: