File tree 1 file changed +12
-0
lines changed
1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -902,6 +902,12 @@ impl str {
902
902
///
903
903
/// assert_eq!(None, iter.next());
904
904
/// ```
905
+ ///
906
+ /// If the string is empty or all whitespace, the iterator yields no string slices:
907
+ /// ```
908
+ /// assert_eq!("".split_whitespace().next(), None);
909
+ /// assert_eq!(" ".split_whitespace().next(), None);
910
+ /// ```
905
911
#[ must_use = "this returns the split string as an iterator, \
906
912
without modifying the original"]
907
913
#[ stable( feature = "split_whitespace" , since = "1.1.0" ) ]
@@ -946,6 +952,12 @@ impl str {
946
952
///
947
953
/// assert_eq!(None, iter.next());
948
954
/// ```
955
+ ///
956
+ /// If the string is empty or all ASCII whitespace, the iterator yields no string slices:
957
+ /// ```
958
+ /// assert_eq!("".split_ascii_whitespace().next(), None);
959
+ /// assert_eq!(" ".split_ascii_whitespace().next(), None);
960
+ /// ```
949
961
#[ must_use = "this returns the split string as an iterator, \
950
962
without modifying the original"]
951
963
#[ stable( feature = "split_ascii_whitespace" , since = "1.34.0" ) ]
You can’t perform that action at this time.
0 commit comments