Check out example codes for "get last index of string rust". It will help you in understanding the concepts better.

Code Example 1

fn main() {
    let s = "/test1/test2/test3";
    let pos = s.rfind('/');

    println!("{:?}", pos); // prints "Some(12)"
}

Learn ReactJs, React Native from akashmittal.com