I have a string array like this:
String tweetString = ExudeData.getInstance().filterStoppingsKeepDuplicates(tweets.text);
// get array of words and split
String[] wordArray = tweetString.split(" ");
After I split the array, I print the following:
System.out.println(Arrays.toString(wordArray));
And the output I get is:
[new, single, fallin, dropping, days, artwork, hueshq, production, iseedaviddrums, amp, bigearl7, mix, reallygoldsmith, https, , , t, co, dk5xl4cicm, https, , , t, co, rvqkum0dk7]
What I want is to remove all the instances of commas, https, and single letters like 't' (after using split
method above). So I want to end up with this:
[new, single, fallin, dropping, days, artwork, hueshq, production, iseedaviddrums, amp, bigearl7, mix, reallygoldsmith, co, dk5xl4cicm, https, co, rvqkum0dk7]
I've tried doing replaceAll like this:
String sanitizedString = wordArray.replaceAll("\\s+", " ").replaceAll(",+", ",");
But that just gave me the same initial output with no changes. Any ideas?