aspose file tools*
The moose likes Java in General and the fly likes How to find substring after a given separator in Java String Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "How to find substring after a given separator in Java String" Watch "How to find substring after a given separator in Java String" New topic
Author

How to find substring after a given separator in Java String

sony vijay
Ranch Hand

Joined: Jun 27, 2010
Posts: 32
Hi,

Answer: I guess using StringUtils.subStringAfter() function should do this. I am not sure how to delete the post so am posting the answer myself

Question: Say I have a String like so: "prefix_somestring"

Is there a way to find substring after the separator "prefix_" i.e. the output should be "somestring"

Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Try this:


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39865
    
  28
Do you not know how to find the index of the _ character?
Enrico Rosina
Greenhorn

Joined: Nov 06, 2010
Posts: 14
Hello,

Is this what you are looking for (?) :
ujjawal rohra
Ranch Hand

Joined: Mar 20, 2010
Posts: 105
You can use :



SCJP 6
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How to find substring after a given separator in Java String