• 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

need help in string new line!!

 
Ranch Hand
Posts: 1880
Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I need one help.
I am reading one file called test.txt.It has the following data:

v,2
h,4
5,y

I am storing these values in a String object.
I want to pass these string object to a method as an argument and i need to break these data into
separate line.
like :
first line will be v,2
second line h,4
third line 5,y

I shold not use BufferReader class to read as a line.Only string content can be passed as parameter.
Can you help me ?

Thanx in advance.
 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
use class Tokenizer for splitting the string into different
parts. give the splitting position as space or enter key.

i think this ll reduce ur probs

ajay
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't post the same question to multiple forums; it's a waste of people's time. I've deleted the several other copies of this thread that you created.
reply
    Bookmark Topic Watch Topic
  • New Topic