I have a string in format /remove_this/I_want_this_onward/any_number_of_characters.
I want to remove /remove_this and want to get remaining string i.e. /I_want_this_onward/any_number_of_characters.
Ex. Input String /myApp/home/welcome , I want to extract /home/welcome.
What will be the the easiest way in Java to get it done ?
EDIT: (extracted from comments)
I want it to extract /home/welcome from redirect:/myapp/home/welcome.
Assuming your comment in Daniel’s answer is the last word, I’m guessing you wish to find the second forward slash, and copy the remaining characters.
Here’s my attempt.
if you wish to find the third forward slash, you’d add the following line in between the two lines of code above:
if you wish to find the fourth, fifth, sixth, etc. forward slash, you would put the above statement in a
WHILEloop, in between the two lines of code above.