fn delete_through_first_char(s: &str, ch: char) -> &str {
    match memchr(ch as u8, s.as_bytes()) {
        None => s, // not found => return the whole string
        Some(pos) => &s[pos + 1..],
    }
}
/// Delete all character through and including the first appearance
/// of character `ch` in inputted `&str` `s`. Program uses this to
/// remove character through first tab or first space, a common task
/// when dealing with diceware passphrase word lists that have dice roll
/// numbers before each word. The
/// [EFF long list](https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt)
/// is one such example.
///
/// Uses [memchr library](https://docs.rs/memchr/latest/memchr/)
/// to find this character a bit quicker than standard function.
///
/// I outlined other approaches to this function in
/// [a separate repo](https://github.com/sts10/splitter/blob/main/src/lib.rs).


Uses [memchr library]
to find this character a bit quicker than standard function.

I outlined other approaches to this function in
[a separate repo].
Uses [ memchr library ] to find this character a bit quicker than standard function . I outlined other approaches to this function in [ a separate repo ] .
fn delete_through_first_char(s: &str, ch: char) -> &str {
    match memchr(ch as u8, s.as_bytes()) {
        None => s, // not found => return the whole string
        Some(pos) => &s[pos + 1..],
    }
}
fn delete_through_first_char ( s : & str , ch : char ) -> & str { match memchr ( ch as u8 , s . as_bytes ( ) ) { None => s , // not found => return the whole string Some ( pos ) => & s [ pos + 1 .. ] , } }
Delete all character through and including the first appearance
of character `ch` in inputted `&str` `s`.
Delete all character through and including the first appearance of character ` ch ` in inputted ` &str ` ` s ` .
s
&str
ch
char
s
&str
ch
char