Check out this article, http://www.sqlservercentral.com/articles/TSQL/62867/. It contains a great method for parsing a string in the Stepping through Characters section about halfway down.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question