Mega Code Archive

 
Categories / Java / Data Type
 

String to word

import java.util.ArrayList; import java.util.List; public class Util{      public List<String> buildWordList(final String document) {              if (document == null) {           // Return empty list.           return new ArrayList<String>();       }       final String [] words = document.split("\\s");                 final List<String> list = new ArrayList<String>();       for (String word : words) {           list.add(word);       } // End of the For //       return list;   }    }