Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String fileName = "Document.txt";
- File file = new File(fileName);
- String para = "";
- int threePlus = 0;
- try{
- Scanner scan = new Scanner(file);
- while(scan.hasNextLine())
- {
- para+=scan.nextLine();
- }
- }catch(Exception e)
- {
- e.printStackTrace();
- }
- String words[] = para.split("\\s+");
- for(int i =0; i<words.length; i++)
- {
- words[i] = words[i].replace("[^\\w]"," ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement