Meaningless Drivel is fun!
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

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
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: 613
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
It's not a secret anymore!