Returns an iterator of at most `limit` substrings of `text` delimited by a match of the regular expression. (A `limit` of `0` will return no substrings.) Namely, each element of the iterator corresponds to text that *isn't* matched by the regular expression. The remainder of the string that is not split will be the last element in the iterator. This method will *not* copy the text given. # Examp
(
&'r self,
text: &'t [u8],
limit: usize,
)
| 341 | /// # } |
| 342 | /// ``` |
| 343 | pub fn splitn<'r, 't>( |
| 344 | &'r self, |
| 345 | text: &'t [u8], |
| 346 | limit: usize, |
| 347 | ) -> SplitN<'r, 't> { |
| 348 | SplitN { |
| 349 | splits: self.split(text), |
| 350 | n: limit, |
| 351 | } |
| 352 | } |
| 353 | |
| 354 | /// Replaces the leftmost-first match with the replacement provided. The |
| 355 | /// replacement can be a regular byte string (where `$N` and `$name` are |