Results 1 to 1 of 1

Thread: StringTokenizer

  1. #1
    Java Tip's Avatar
    Java Tip is offline Moderator
    Join Date
    Nov 2007
    Posts
    1,694
    Blog Entries
    430
    Rep Power
    10

    Default StringTokenizer

    StringTokenizer is very useful when we want to extract tokens from some text. While initializing StringTokenizer, we have to specify the string that contains the test and also the delimiter. Syntax of StringTokenizer is as follows:
    Java Code:
      [COLOR=black][FONT=&quot]StringTokenizer st = [/FONT][/COLOR][B][COLOR=#7f0055][FONT=&quot]new[/FONT][/COLOR][/B][COLOR=black][FONT=&quot] StringTokenizer  ( str, [/FONT][/COLOR][COLOR=#2a00ff][FONT=&quot]" "[/FONT][/COLOR][COLOR=black][FONT=&quot] ) ;[/FONT][/COLOR]
      
      [B][COLOR=#7f0055][FONT=&quot]while[/FONT][/COLOR][/B][COLOR=black][FONT=&quot]  (st_server.hasMoreTokens())[/FONT][/COLOR]
      [COLOR=black][FONT=&quot]{[/FONT][/COLOR]
      [COLOR=black][FONT=&quot]…[/FONT][/COLOR]
      [COLOR=black][FONT=&quot]}
    [/FONT][/COLOR]
    Last edited by Java Tip; 11-04-2007 at 07:00 PM.

Similar Threads

  1. StringTokenizer
    By carderne in forum New To Java
    Replies: 1
    Last Post: 01-26-2008, 09:19 PM
  2. How to use StringTokenizer for multiple tokens
    By javaplus in forum New To Java
    Replies: 2
    Last Post: 11-29-2007, 10:38 AM
  3. StringTokenizer
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-08-2007, 09:48 AM

Posting Permissions

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