aspose file tools*
The moose likes Java in General and the fly likes Parsing a Stirng consisting of tabs and newlines Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Parsing a Stirng consisting of tabs and newlines" Watch "Parsing a Stirng consisting of tabs and newlines" New topic
Author

Parsing a Stirng consisting of tabs and newlines

Sreek Gupta
Greenhorn

Joined: Mar 08, 2006
Posts: 24
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

Joined: Jun 06, 2005
Posts: 241
You may wish to use String.split(regex) method. Is that all you were looking for ?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Not an advanced topic. Moving...


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Parsing a Stirng consisting of tabs and newlines