Link to home
Create AccountLog in
Avatar of PeterBaileyUk
PeterBaileyUk

asked on

Clear triple or double spaces in string

I have been performing operations by removing certain words but need to tdy up the string so that only 1 space is between the words
example below. if i do replace and "  " or "   " in some cases it removed the single space that i needed.
Expr1

80
80   CC
80   CL
80   SPECIAL
80  FI
80  QUATTRO
80  SE
80 CC
80 CL
80 CLE
80 E
80 E QUATTRO
80 E SE
80 GL
80 GLE
80 GLS
80 GT
80 GTE
80 L
80 LS
80 QUATTRO
80 QUATTRO FI
80 QUATTRO GTE
80 QUATTRO SE
80 RS2
80 S
80 S2
80 SC
80 SE
80 SPECIAL
80 SPORT
80 SPORT SE
ASKER CERTIFIED SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of PeterBaileyUk
PeterBaileyUk

ASKER

is this in regex or just replace function?
got it great thx
You're welcome.
Other method is:

 Do until Instr(strCheck,"  ")=0
   Replace(strCheck, "  "," ")
 Loop