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

disecting a string

 
trupti nigam
Ranch Hand
Posts: 627
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
can somebody tell me how to dissect the string into substrings..
String mystring = "how are you these days"
String string1 = "how"
String string2 = "are"
String string3 = "you"
String string4 = "these"
String string5 = "days"
it's urgent..
thanks
trupti
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The best way is probably to use StringTokenizer using a space as the delimiter.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic