MCPcopy Create free account
hub / github.com/davidblewett/rure-python / splitn

Method splitn

regex/src/re_unicode.rs:397–403  ·  view source on GitHub ↗

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 str, limit: usize)

Source from the content-addressed store, hash-verified

395 /// # }
396 /// ```
397 pub fn splitn<'r, 't>(&'r self, text: &'t str, limit: usize)
398 -> SplitN<'r, 't> {
399 SplitN {
400 splits: self.split(text),
401 n: limit,
402 }
403 }
404
405 /// Replaces the leftmost-first match with the replacement provided.
406 /// The replacement can be a regular string (where `$N` and `$name` are

Callers

nothing calls this directly

Calls 1

splitMethod · 0.45

Tested by

no test coverage detected