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 Formatting a String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Formatting a String" Watch "Formatting a String" New topic

Formatting a String

Kamal Patel

Joined: Nov 05, 2003
Posts: 18
I am trying to format a string e.g.
to just extract the "Application" part of the string?
I think you can use the StringTokenizer class and "=" as a delimeter, but I tried that and it did not work for me!
Can someone please tell me how to do this and give me an example piece of code if possible?
Tom Wolve
Ranch Hand

Joined: Sep 22, 2003
Posts: 32
hope the following code fragment will help
Brian Pipa
Ranch Hand

Joined: Sep 29, 2003
Posts: 299
You can also use String.indexOf("=") to see where the equals sign is then use String.substring() to just grab everything after the =

My Java Freeware:<br />MACCC - <a href="" target="_blank" rel="nofollow"></a><br />Nator - <a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Formatting a String
It's not a secret anymore!