If you're a Java programmer, an easy way to break a string apart is with the java.util.StringTokenizer class.
java.util.StringTokenizer