Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Parsing a Stirng consisting of tabs and newlines

 
Sreek Gupta
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a String which consists of tabs and newlines in it.
I want to parse it using java.
Can anyone provide me some piece of code to do the same.

Ex: Suppose i have a string as follows:

Srikanth <enter a tab here> Gupta
<enter a newline here>
From <enter a tab here> India

Output should be
Srikanth
Gupta
From
India

Please help me.

Regds,
Srikanth
 
Srikanth Basa
Ranch Hand
Posts: 241
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You may wish to use String.split(regex) method. Is that all you were looking for ?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not an advanced topic. Moving...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic