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 {
1495
1495
/// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a
1496
1496
/// function or closure that determines if a character matches.
1497
1497
///
1498
+ /// If there are no matches the full string slice is returned as the only
1499
+ /// item in the iterator.
1500
+ ///
1498
1501
/// [`char`]: prim@char
1499
1502
/// [pattern]: self::pattern
1500
1503
///
@@ -1526,6 +1529,9 @@ impl str {
1526
1529
/// let v: Vec<&str> = "lion::tiger::leopard".split("::").collect();
1527
1530
/// assert_eq!(v, ["lion", "tiger", "leopard"]);
1528
1531
///
1532
+ /// let v: Vec<&str> = "AABBCC".split("DD").collect();
1533
+ /// assert_eq!(v, ["AABBCC"]);
1534
+ ///
1529
1535
/// let v: Vec<&str> = "abc1def2ghi".split(char::is_numeric).collect();
1530
1536
/// assert_eq!(v, ["abc", "def", "ghi"]);
1531
1537
///
You can’t perform that action at this time.
0 commit comments