permaculture playing cards*
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: 38007
    
  22
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to find substring after a given separator in Java String
 
Similar Threads
Does anyone know how to read a log file in .log and output the data using java language ?
String index out of bound at index 0?! HELP!
Doubt in Parsing(Regex)
XSLT select question
Parse String