Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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


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



Regards,
cmbhatt
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic