File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -1495,6 +1495,9 @@ impl str {
14951495 /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
14961496 /// function or closure that determines if a character matches.
14971497 ///
1498+ /// If there are no matches the full string slice is returned as the only
1499+ /// item in the iterator.
1500+ ///
14981501 /// [`char`]: prim@char
14991502 /// [pattern]: self::pattern
15001503 ///
@@ -1526,6 +1529,9 @@ impl str {
15261529 /// let v: Vec<&str> = "lion::tiger::leopard".split("::").collect();
15271530 /// assert_eq!(v, ["lion", "tiger", "leopard"]);
15281531 ///
1532+ /// let v: Vec<&str> = "AABBCC".split("DD").collect();
1533+ /// assert_eq!(v, ["AABBCC"]);
1534+ ///
15291535 /// let v: Vec<&str> = "abc1def2ghi".split(char::is_numeric).collect();
15301536 /// assert_eq!(v, ["abc", "def", "ghi"]);
15311537 ///
You can’t perform that action at this time.
0 commit comments