List of utility methods to do Scanner Usage
void | waitForStopSignal() wait For Stop Signal Scanner in = new Scanner(System.in); while (!TERM_TOKEN.equals(in.next())) ; |
String | wrap(String msg, int wrapWidth, int wrapTolerance) Attempts to wrap the supplied string with the given width. if (msg == null) throw new IllegalArgumentException("Argument must not be null."); if (wrapWidth <= 0) wrapWidth = 50; if (wrapTolerance < 0) wrapTolerance = 5; StringBuilder buf = new StringBuilder(); Scanner sc = new Scanner(msg); ... |