UPDATE: Use single replace instead of two

It is slightly faster and saves bytes :)

http://jsperf.com/trim-replace-replace-vs-replace