aspose file tools*
The moose likes Java in General and the fly likes to divide a string Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "to divide a string" Watch "to divide a string" New topic

to divide a string

vijay umar
Ranch Hand

Joined: Mar 24, 2009
Posts: 100
how to divide a string into 3 parts and assign it to three different variables?
Rob Spoor

Joined: Oct 27, 2005
Posts: 19556

You can use String.split if you have a special separator. Another option is a combination of indexOf and substring. In both cases it's important to know where to split the String.

How To Ask Questions How To Answer Questions
bhanu chowdary
Ranch Hand

Joined: Mar 09, 2010
Posts: 256
On what basis do you want to split your string??
I agree. Here's the link:
subject: to divide a string
Similar Threads
Divide a String
Using Java to convert mm to m, cm and mm
palindrome program
int---->integer array
WA #1.....word association