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
JavaRanch » Java Forums » Java » Java in General
Bookmark "to divide a string" Watch "to divide a string" New topic
Author

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
Sheriff

Joined: Oct 27, 2005
Posts: 19785
    
  20

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.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
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: http://aspose.com/file-tools
 
subject: to divide a string