remove all unwanted chars in one loop