List of usage examples for java.util Scanner remove
public void remove()
From source file:Main.java
public static void main(String[] args) { String s = "java2s.com 1 + 1 = 2.0 true "; Scanner scanner = new Scanner(s); System.out.println(scanner.nextLine()); // attempt to call remove results in an exception scanner.remove(); scanner.close();/*from w w w . j a v a 2 s . co m*/ }