StringTokenizer asdfqwerty = new StringTokenizer(inputText,"<asdf></asdf>"); while(asdfqwerty.hasMoreTokens()){ String palabra = asdfqwerty.nextToken(); }