reverse string and remove space