diff options
Diffstat (limited to 'components/util/str.rs')
-rw-r--r-- | components/util/str.rs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/util/str.rs b/components/util/str.rs index fe23c1b5ff6..7af63f4c7f3 100644 --- a/components/util/str.rs +++ b/components/util/str.rs @@ -41,6 +41,10 @@ pub fn split_html_space_chars<'a>(s: &'a str) -> s.split(HTML_SPACE_CHARACTERS).filter(not_empty as fn(&&str) -> bool) } +pub fn split_commas<'a>(s: &'a str) -> Filter<Split<'a, char>, fn(&&str) -> bool> { + fn not_empty(&split: &&str) -> bool { !split.is_empty() } + s.split(',').filter(not_empty as fn(&&str) -> bool) +} fn is_ascii_digit(c: &char) -> bool { match *c { |