My code at the moment uses a link pattern to write a String to a text file while removing all words that start with "@" and "https".
PrintWriter wordCloudText = new PrintWriter(wordCloudTextFile);
Pattern linkPattern2 = Pattern.compile("(https|@)\\S*");
wordCloudText.println(linkPattern.matcher(text.replaceAll(""));
It is an array list of Strings, and some Strings can have multiple lines, how would I get it so that the the link pattern also removes return characters so that it is written to only one line of my text file.
Hope this is clear, Thanks for your help
Aucun commentaire:
Enregistrer un commentaire