Javascript doesn't natively support trim on strings. It is however very easy to implement with regular expressions.