Answers for "get last index of string 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

Browse Popular Code Answers by Language