Document split{_ascii,}_whitespace() for empty strings
This commit is contained in:
parent
4e0d0d757e
commit
07ccf67f59
@ -902,6 +902,12 @@ impl str {
|
|||||||
///
|
///
|
||||||
/// assert_eq!(None, iter.next());
|
/// assert_eq!(None, iter.next());
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// If the string is empty or all whitespace, the iterator yields no string slices:
|
||||||
|
/// ```
|
||||||
|
/// assert_eq!("".split_whitespace().next(), None);
|
||||||
|
/// assert_eq!(" ".split_whitespace().next(), None);
|
||||||
|
/// ```
|
||||||
#[must_use = "this returns the split string as an iterator, \
|
#[must_use = "this returns the split string as an iterator, \
|
||||||
without modifying the original"]
|
without modifying the original"]
|
||||||
#[stable(feature = "split_whitespace", since = "1.1.0")]
|
#[stable(feature = "split_whitespace", since = "1.1.0")]
|
||||||
@ -946,6 +952,12 @@ impl str {
|
|||||||
///
|
///
|
||||||
/// assert_eq!(None, iter.next());
|
/// assert_eq!(None, iter.next());
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// If the string is empty or all ASCII whitespace, the iterator yields no string slices:
|
||||||
|
/// ```
|
||||||
|
/// assert_eq!("".split_ascii_whitespace().next(), None);
|
||||||
|
/// assert_eq!(" ".split_ascii_whitespace().next(), None);
|
||||||
|
/// ```
|
||||||
#[must_use = "this returns the split string as an iterator, \
|
#[must_use = "this returns the split string as an iterator, \
|
||||||
without modifying the original"]
|
without modifying the original"]
|
||||||
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
|
#[stable(feature = "split_ascii_whitespace", since = "1.34.0")]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user