File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes disecting a string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "disecting a string" Watch "disecting a string" New topic

disecting a string

trupti nigam
Ranch Hand

Joined: Jun 21, 2001
Posts: 614
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..
Cindy Glass
"The Hood"

Joined: Sep 29, 2000
Posts: 8521
The best way is probably to use StringTokenizer using a space as the delimiter.

"JavaRanch, where the deer and the Certified play" - David O'Meara
I agree. Here's the link:
subject: disecting a string
jQuery in Action, 3rd edition