MCPcopy Create free account
hub / github.com/StudyRust/leetcode_rust / main

Function main

2000-reverse-prefix-of-word.rs:12–16  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10// 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。
11
12fn main() {
13 let word = "abcdefd".to_string();
14 let ch = 'd';
15 println!("{:?}", reverse_prefix(word, ch));
16}
17
18pub fn reverse_prefix(word: String, ch: char) -> String {
19 let s_index = word.find(ch);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected