in reply to keeping spaces

Show us the code you're using. Give us some sample input, if possible. Tell us what you expect it to do and what it is doing instead.