if old == SENTE {
line += &STR_SENTE.chars().nth(count).unwrap().to_string();
} else if old == GOTE {
line += &STR_GOTE.chars().nth(count).unwrap().to_string();
} else if old == BLANK {
line += &STR_NUM.chars().nth(count).unwrap().to_string();
}
let s: &str = "xyz<123>";
let bytes: &[u8] = s.as_bytes();
assert_eq!(*bytes.get(2).unwrap() as char, 'z');
assert_eq!(*bytes.get(5).unwrap() as char, '2');
同じ文字列から繰り返し文字を取得する場合 https://rs.nkmk.me/rust-str-nth-char/#h2_3
String::push(char)
でいいらしい https://stackoverflow.com/questions/37889337/how-to-concatenate-a-char-onto-a-string-in-rust