on-internet
← Community

Remove only spaces and ignore tabs in a string

Stack Overflow ·

I have a string which has both spaces and tabs. I would like to remove all the occurrences of spaces in the string but keep the tab spaces as is. I would like to preserve the tabs so that I can use the tab-delimiter option in Excel when I import the text file.

Comments

Sign in or sign up to comment and upvote.

No comments yet.