更新时间:2023-11-14 23:08:58
您将使用
You would use str::find on a substr and then add the offset back:
str::find
let s = "foobarfoo"; let index: Option<usize> = s[4..].find("foo").map(|i| i + 4); println!("{:?}", index);
Some(6)
如何在Rust中从特定索引开始的子字符串中查找?
如何在Swift 4中获取从特定字符到字符串结尾的子字符串?
如何在字符串中查找特定的掩码-Oracle?