Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Formatting a String

 
Kamal Patel
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
hope the following code fragment will help
 
Brian Pipa
Ranch Hand
Posts: 299
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can also use String.indexOf("=") to see where the equals sign is then use String.substring() to just grab everything after the =
Brian
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic