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

parsing strings

 
Randy Trover
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi all,
I need to parse out the individual tokens from a comma delineated string. "123,23,,34,36" ect. Does java give you a string handling function to do this or do I have to write my own? Thanks for any help.

Cheers
Randy
 
Junilu Lacar
Bartender
Posts: 7595
53
Android Eclipse IDE IntelliJ IDE Java Linux Mac Scala Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the java.util.StringTokenizer will do the job for you.
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stringtokenizer
"http://java.sun.com/products/jdk/1.1/docs/api/java.util.StringTokenizer.html"
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic