You had the code tags wrong, but I have corrected that for you. Don't post the same post twice; I have deleted the duplicate.
Where are you searching the String? I can see some file reading code which appears to be in a class called Search, but that won't compile. I think you have a line missing. You are also counting occurrences in an array, but that is obviously something different. Do you know how to use the methods of the String class to find an included substring? Do you know how to work out the length of that substring? Do you know how to use another String method to find the remainder of the String as a substring?
What are you going to do it the search text is not found, or there are no quote marks?
posted 3 years ago
Thanks a lot.
Yes, i have mistakenly put wrong code here and of course, counting occurrences is not required here.
Can you please brief me how to fetch the remaining string using "length of that substring" and "remainder of the String as a substring".
Nitish Nagar wrote:
Please post solution of my question instead. Thanks
Unfortunately, this is not in the spirit of the ranch. The ranch is a learning site. If you have a specific question, we can answer it, or hint you towards it. If you are stuck on an error, we can help you towards understanding it, or locating it. If you are stuck on code, we can help you locate your issue. Regardless. you will need to do the heavy lifting, as that is the best way to learn.