Question: In a program on java, I am to take the first index of a substring and the last index of a substring Input = #fet

In a program on java, I am to take the first index of a substring and the last index of a substring

Input = #fet value; #ret value; #tet value;

Now from this I am supposed to take the substring: #fet value; and get the index of "#fet" and ";". My issue is that I don't know how to the last.IndexOf(";") without getting the actual last ";". Typing int x = input.lastIndexOf(";"); just gets me the index of the actual lst";" instead of the one after #fet value. I need to do this for every one of the substrings.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!