Help reading a text file.
Hi, I'm new here and I'm having some trouble with a java program.
I have to read a text file (The user provides the name). The program must follow these rules as well.
The first rule is that a word consists of what the next() method of the Scanner class will return. The next() method returns a String that consists of all the characters in the input up to, but not including, the next “whitespace character”, where blank spaces, tabs, and newline characters are the whitespace characters.
The second rule: If the word has a single- or double-quotation mark as the first character of the word, remove it.
The third rule: Look at the last character of the word. If this last character is any one of •single-quotation mark, double-quotation mark, semi-colon, colon, period, comma, hyphen, exclamation point, question mark, remove it.
So far i have this
public class Trimming
public static void man(String  args) throws IOException
File inputFile = new File( "Sample.txt" );
Scanner fileScan = new Scanner( inputFile );
int number = fileScan.nextInt();