Results 1 to 2 of 2
  1. #1
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    8

    Default StringTokenizer versus Scanner concerning the delimiter

    The old fashioned Token class has the constructor StringTokenizer(...):
    StringTokenizer st = new StringTokenizer(data, "\t", true);
    Where if true "st" includes the delimiter.

    How could one get a similar result with the newer scanner class?

    Scanner sc = new Scanner(data);
    sc.useDelimiter("\t");
    But now "sc" does not include the tabs, but I want them to be there...
    So what to do?

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,967
    Rep Power
    19

    Default Re: StringTokenizer versus Scanner concerning the delimiter

    Closing this duplicate.
    You should know better than to double post...
    Please do not ask for code as refusal often offends.

    ** This space for rent **

Similar Threads

  1. StringTokenizer versus Scanner concerning the delimiter
    By willemjav in forum Advanced Java
    Replies: 19
    Last Post: 11-21-2013, 05:05 PM
  2. Scanner Delimiter
    By Games2Design in forum New To Java
    Replies: 1
    Last Post: 03-22-2013, 05:16 PM
  3. Scanner delimiter issue
    By PrinceSendai in forum New To Java
    Replies: 3
    Last Post: 10-05-2010, 09:41 AM
  4. Replies: 1
    Last Post: 02-20-2009, 02:06 PM
  5. Use of Scanner class and Delimiter
    By tjhodge in forum New To Java
    Replies: 3
    Last Post: 02-12-2009, 05:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •