Forums Register Login

Formatting a String

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Hi,
hope the following code fragment will help
+Pie Number of slices to send: Send
You can also use String.indexOf("=") to see where the equals sign is then use String.substring() to just grab everything after the =
Brian
Paper jam tastes about as you would expect. Try some on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 675 times.
Similar Threads
opening and saving using JFileChooser
byte array to string
String handling
String handling
log4j and large string buffers
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 03:55:14.