https://atcoder.jp/contests/abc268/tasks/abc268_b
部分文字列はこんな感じで取れるようです。
let sub = &T[..S.len()];
// Prefix? #![allow(non_snake_case)] fn read<T: std::str::FromStr>() -> T { let mut line = String::new(); std::io::stdin().read_line(&mut line).ok(); line.trim().parse().ok().unwrap() } fn is_prefix(S: &String, T: &String) -> bool { if S.len() > T.len() { return false } let sub = &T[..S.len()]; S == sub } fn main() { let S: String = read(); let T: String = read(); println!("{}", if is_prefix(&S, &T) { "Yes" } else { "No" }) }