Give NewlinePattern
a method that returns a configurable splitter on a given string
#3
Labels
enhancement
New feature or request therefor
Milestone
Method name:
split()
?The method takes a
&'a str
and returns aSplitter<'a>
(Name not fixed), which implementsDoubleEndedIterator<Item=&'a str>
(or just implementsIntoIterator
returning a separateDoubleEndedIterator
type?)Splitter
has the following methods for configuring its behavior:inclusive(self) -> Self
— Causes terminating patterns to be included in the strings yielded by the iterator andonce()
""
when the input is the empty string.limit(self, n: usize) -> Self
— cf.str::splitn()
once(self) -> Option<(&'a str, &'a str)>
— Splits the input string only on the first occurrence of the patternCf. the API of https://crates.io/crates/str_splitter
The text was updated successfully, but these errors were encountered: