aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes String splitting 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 "String splitting" Watch "String splitting" New topic
Author

String splitting

saikiran venkata
Greenhorn

Joined: Oct 31, 2010
Posts: 29

hello everyone,



it is printing

....> <....
....><....
....><....
....> <....
....> <....

but there are no empty tokens in iran why?


SCJP 1.6 | SCWCD 5
The earth is enjoyed by heroes—this is the unfailing truth. Be a hero. Always say, “I have no fear." ~Swami Vivekananda.
Hareendra Reddy
Ranch Hand

Joined: Jan 09, 2011
Posts: 173

Hello Sai kiran ,

If you use split method of the string the trailing empty strings are discarded..
refer java.lang.String class documentation, there is another overloaded method which takes
one more integer as argument lets you include empty strings as well...
 
jQuery in Action, 2nd edition
 
subject: String splitting
 
Similar Threads
String literal Pool doubt
Understanding logic on for loop
Static blocks
Binary to Decimal conversion
error in formatting miliseconds for date objects