• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Using Delimiters

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am having input like this: This , Is First Line
This Is Second Line

I am currently using a String Tokenizer(string, ",",false) for reading tokens and not including the ","
But I want to add more options to the delimiters. As my second line does not contain "," and that gives me an error
Is there a more efficient way other that using StringTokenizer???
or is it wiser to use string.split() and add all elements to an array and then print it out??? That just seems longer and extra array!
Please Help.

Thank you
J
 
Rancher
Posts: 618
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jill Iyer wrote:Hi,

I am having input like this: This , Is First Line
This Is Second Line

I am currently using a String Tokenizer(string, ",",false) for reading tokens and not including the ","
But I want to add more options to the delimiters. As my second line does not contain "," and that gives me an error
Is there a more efficient way other that using StringTokenizer???
or is it wiser to use string.split() and add all elements to an array and then print it out??? That just seems longer and extra array!
Please Help.

Thank you
J



What is your desired result?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic