Answers for "find last index of something in rust"

0

get last index of string rust

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

    println!("{:?}", pos); // prints "Some(12)"
}
Posted by: Guest on October-18-2020

Code answers related to "find last index of something in rust"

Browse Popular Code Answers by Language