I have below string
String = "Test1 Test2 Test3 Test4 Test5 Test6 15min"
I want to get the index of character space before string "min"
There is a method like String.lastIndexOf(" ")
but could not find any thing related?
EDIT:-
Basically want to find last space before the first min
First get the position of the string that you want to get the space before, then use that position to get the closest previous position of space
int idx1 = str.indexOf("min");
int lastSpace = str.lastIndexOf(" ", idx1);
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments