Skip to main content

split_at

Function split_at 

Source
fn split_at<F>(input: &str, predicate: F) -> (&str, &str)
where F: Fn(&char) -> bool,
Expand description

Split an input string at the first character for which the predicate returns false.

In other words, returns the longest prefix span where predicate is satisfied, along with the rest of the string.