File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Formatting a String" Watch "Formatting a String" New topic
Author

Formatting a String

Kamal Patel
Greenhorn

Joined: Nov 05, 2003
Posts: 18
Hi,
I am trying to format a string e.g.
"ou=Applications"
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?
Thanks.
Tom Wolve
Ranch Hand

Joined: Sep 22, 2003
Posts: 32
Hi,
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 =
Brian


My Java Freeware:<br />MACCC - <a href="http://maccc.pipasoft.com" target="_blank" rel="nofollow">http://maccc.pipasoft.com</a><br />Nator - <a href="http://nator.pipasoft.com" target="_blank" rel="nofollow">http://nator.pipasoft.com</a>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Formatting a String
 
Similar Threads
opening and saving using JFileChooser
String handling
String handling
log4j and large string buffers
byte array to string