Advertisement
gdog2u

Not Working

Jan 27th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.38 KB | None | 0 0
  1. public static ArrayList<String> puncRemover(ArrayList<String> words){
  2.     String[] punc = {".", ",", "\\?", "!", "'", "\""};
  3.     for(String word : words){
  4.         for(String s : punc){
  5.             if(word.contains(s)){
  6.                 word = word.replaceAll(s, "");
  7.                 if(!word.contains(s)){
  8.                     System.out.println("Removed " + s);
  9.                 }
  10.             }
  11.         }
  12.     }
  13.     System.out.println("Punctuation removed.");
  14.     return words;
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement