aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes split() method, How does it work??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "split() method, How does it work???" Watch "split() method, How does it work???" New topic
Author

split() method, How does it work???

Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707


Output:
>ab<
> ccc <
>< // Line 1
>< // Line 2
> <
>< // Line 3
> @<


Please Help regarding Line 1 , 2 and 3. What do they contain???



Regards,
cmbhatt


cmbhatt
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Originally posted by Chandra Bhatt:
...Please Help regarding Line 1 , 2 and 3. What do they contain??? ...

Line 1 is the empty String between 4 and 5.
Line 2 is the empty String between 5 and 5.
Line 3 is the empty String between 6 and 7.


"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
O I SEE!!!

Means if the splitting pattern is digit as I did, empty string
also come under a token!!! Right!!!



Thank you very much Marc!!!


cmbhatt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: split() method, How does it work???