File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spliting a String from a particular character

 
abhinas raj
Ranch Hand
Posts: 51
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to split a String from a particular character please some one write the code how to do that

String str1="city-state";

i wnat "city" and "state" to be stored in two different seperate variable. like in str2 and str3 how to do that .
 
Jelle Klap
Bartender
Posts: 1951
7
Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, nobody is going to write that code for you, nor should they. Beside the fact that JavaRanch is NotACodeMill (<- click) this sort of thing is very important to master yourself. Especially considering the forum you posted this in. If you take a look at the String API, under Method Summary, you should be able to find a method that will allow you to do what you're looking for. Let's start by identifying that method.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic