tmajor99
asked on
Regular Expression to remove all spaces
I need a regular expression that will remove all spaces from a string including leading and training spaces.
Data: Expected Result
L P M LPM
LPM LPM
LPM LPM
L PM LPM
L P M LPM (double space example)
1 0 0 0 1000
Data: Expected Result
L P M LPM
LPM LPM
LPM LPM
L PM LPM
L P M LPM (double space example)
1 0 0 0 1000
A regular expression replacement would just use a single space as the pattern, and an empty string as the replacement. If you also wanted to replace line feed, newline and tab characters, the pattern would be \s
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
s = Replace(s, " ", "")
»bp