Use index of indexOf() to locate characters within the the tokens generated by StringTokenizer. You may want to create new strings with the new String( str1.substring(5,10) + str2.substring(15,30))