Function strsplit::until_char

source ·
pub fn until_char<'s>(s: &'s str, c: char) -> &'s str
Expand description

Returns the string before the first instance of the delimiter is found E.g


   let haystack = "hello";
let trimmed = until_char(&haystack, 'o');
assert_eq!(trimmed, "hell");