Code example for Scanner

Methods: hasNext, next

0
   static FileOutputStream fos;
 
   static final String     dp                = "\\" + new Character('"');
 
   private static String getNext(Scanner scanner) {
      String out = scanner.hasNext() ? scanner.next() : "";
      if (out == null) {
         out = "";
      } 
      out = out.replaceAll("\\n", "");
      out = out.replaceAll(dp, "'");
      out = out.trim();
      return out;
   } 
 
   private static String getNextLine(Scanner scanner) {
      String out = scanner.hasNext() ? scanner.nextLine() : "";
      if (out == null) {
         out = "";
      } 
      out = out.replaceAll("\\n", "");