while(tokenizer.hasMoreTokens()){
currentWord = tokenizer.nextToken();
String[] parts = currentWord.split(Pattern.quote("."));
String[] parts2 = parts[0].split(Pattern.quote(","));
String[] parts3 = parts2[0].split(Pattern.quote("?"));
String[] parts4 = parts3[0].split(Pattern.quote("\\.| "));
String[] parts5 = parts4[0].split("\"");
String[] parts6 = parts5[0].split(Pattern.quote(":"));
System.out.println(Arrays.toString(parts6));
I'm just trying to get this text to split properly, only issue right now is the word:
"Have
Also if someone could provide a solution that combines all this into one line that would be nice but I couldn't get that to work thanks
Here is one way if you want to split the line on non-letters.
[^A-Za-z]+split on one or more of non-lettersprints
On the other hand, if you want to remove those characters from a word, use a similar pattern. No need to specify the non-letter characters separately.
prints