String tokenizer + split by spaces in string


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: String tokenizer + split by spaces in string

  1. #1
    Join Date
    Nov 2003
    Posts
    29

    String tokenizer + split by spaces in string

    i want to split a string up by using string tokenizer. The words in the string have a one character gap, using this gap i want to split the string. i saw an example where someone used ' ' but i cant get it to work.

    Code:
    StringTokenizer tok = new StringTokenizer(inputLine);
    String destination = tok.nextToken(' ');
    
    destinations[count]=destination;
    any ideas please ?

  2. #2
    Join Date
    Nov 2003
    Posts
    29
    doh, just in case anyones interested, no parameter is neccessary. a () will split the string nicely . .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center