input-parsing

Scanner, useDelimiter

I encounter some problem when using useDelimiter from the Scanner class. Scanner sc = new Scanner(System.in).useDelimiter("-"); while(sc.hasNext()) { System.out.println(sc.next()); } if I have this input A-B-C the output will be A B and wait until I type in another "-" for it to print out the last character However if...