Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

String splitting

 
saikiran venkata
Greenhorn
Posts: 29
Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello everyone,



it is printing

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

but there are no empty tokens in iran why?
 
Hareendra Reddy
Ranch Hand
Posts: 173
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic