Link to home
Start Free TrialLog in
Avatar of VBdotnet2005
VBdotnet2005Flag for United States of America

asked on

Find space in string

How can I find specific  position of each space? Sample: This is a test only.
Avatar of Anthony Perkins
Anthony Perkins
Flag of United States of America image

You can use the CHARINDEX() function repeatedly.  But I am not sure that alone is going to help much in your quest to split unformatted City State ZIP values.
But I see you have already been given this same answer here:
https://www.experts-exchange.com/questions/26013136/T-sql-contain.html
Avatar of VBdotnet2005

ASKER

How would you do it repeatedly? Charindex(' ',mystring) This would just return the psition of the first ' '. How would you find out the second ' '?
I posted my solution to your unformatted City State ZIP in your other thread (and yes I realize you cannot read code when using EE Mobile):
https://www.experts-exchange.com/questions/25986403/Address-split.html

See there for a good example how to do it.
ASKER CERTIFIED SOLUTION
Avatar of Banthor
Banthor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial