pub trait ToSegmentsFromChars {
// Required methods
fn split_on_any_char(&self, separators: &[char]) -> Vec<String>;
fn to_head_tail_on_any_char(&self, separators: &[char]) -> (String, String);
fn to_start_end_on_any_char(&self, separators: &[char]) -> (String, String);
}
Expand description
Methods to split a &str/String on the first matched separator character
Required Methods§
Sourcefn split_on_any_char(&self, separators: &[char]) -> Vec<String>
fn split_on_any_char(&self, separators: &[char]) -> Vec<String>
Split a string into parts separated by any of the referenced split characters
Sourcefn to_head_tail_on_any_char(&self, separators: &[char]) -> (String, String)
fn to_head_tail_on_any_char(&self, separators: &[char]) -> (String, String)
Split a string into a head and tail separated by the first instance of the first matching separator If none of the separators are matched, the first element is an empty string and the second the whole string
Sourcefn to_start_end_on_any_char(&self, separators: &[char]) -> (String, String)
fn to_start_end_on_any_char(&self, separators: &[char]) -> (String, String)
Split a string into s start and tail separated by the last instance of the first matching separator If none of the separators are matched, the first element is an empty string and the second the whole string