trim is much faster than ctype_space.