@@ -3604,14 +3604,17 @@ impl str {
3604
3604
/// Basic usage:
3605
3605
///
3606
3606
/// ```
3607
- /// let s = " Hello\tworld\t";
3607
+ /// #![feature(trim_direction)]
3608
3608
///
3609
+ /// let s = " Hello\tworld\t";
3609
3610
/// assert_eq!("Hello\tworld\t", s.trim_start());
3610
3611
/// ```
3611
3612
///
3612
3613
/// Directionality:
3613
3614
///
3614
3615
/// ```
3616
+ /// #![feature(trim_direction)]
3617
+ ///
3615
3618
/// let s = " English";
3616
3619
/// assert!(Some('E') == s.trim_start().chars().next());
3617
3620
///
@@ -3640,14 +3643,17 @@ impl str {
3640
3643
/// Basic usage:
3641
3644
///
3642
3645
/// ```
3643
- /// let s = " Hello\tworld\t";
3646
+ /// #![feature(trim_direction)]
3644
3647
///
3648
+ /// let s = " Hello\tworld\t";
3645
3649
/// assert_eq!(" Hello\tworld", s.trim_end());
3646
3650
/// ```
3647
3651
///
3648
3652
/// Directionality:
3649
3653
///
3650
3654
/// ```
3655
+ /// #![feature(trim_direction)]
3656
+ ///
3651
3657
/// let s = "English ";
3652
3658
/// assert!(Some('h') == s.trim_end().chars().rev().next());
3653
3659
///
@@ -3799,6 +3805,8 @@ impl str {
3799
3805
/// Basic usage:
3800
3806
///
3801
3807
/// ```
3808
+ /// #![feature(trim_direction)]
3809
+ ///
3802
3810
/// assert_eq!("11foo1bar11".trim_start_matches('1'), "foo1bar11");
3803
3811
/// assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123");
3804
3812
///
@@ -3838,6 +3846,8 @@ impl str {
3838
3846
/// Simple patterns:
3839
3847
///
3840
3848
/// ```
3849
+ /// #![feature(trim_direction)]
3850
+ ///
3841
3851
/// assert_eq!("11foo1bar11".trim_end_matches('1'), "11foo1bar");
3842
3852
/// assert_eq!("123foo1bar123".trim_end_matches(char::is_numeric), "123foo1bar");
3843
3853
///
@@ -3848,6 +3858,8 @@ impl str {
3848
3858
/// A more complex pattern, using a closure:
3849
3859
///
3850
3860
/// ```
3861
+ /// #![feature(trim_direction)]
3862
+ ///
3851
3863
/// assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo");
3852
3864
/// ```
3853
3865
#[ unstable( feature = "trim_direction" , issue = "30459" ) ]
0 commit comments