File tree 1 file changed +20
-0
lines changed
1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1531,6 +1531,16 @@ impl str {
1531
1531
///
1532
1532
/// assert_eq!("Hello\tworld\t", s.trim_left());
1533
1533
/// ```
1534
+ ///
1535
+ /// Directionality:
1536
+ ///
1537
+ /// ```
1538
+ /// let s = " English";
1539
+ /// assert!(Some('E') == s.trim_left().chars().next());
1540
+ ///
1541
+ /// let s = " עברית";
1542
+ /// assert!(Some('ע') == s.trim_left().chars().next());
1543
+ /// ```
1534
1544
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1535
1545
pub fn trim_left ( & self ) -> & str {
1536
1546
UnicodeStr :: trim_left ( self )
@@ -1557,6 +1567,16 @@ impl str {
1557
1567
///
1558
1568
/// assert_eq!(" Hello\tworld", s.trim_right());
1559
1569
/// ```
1570
+ ///
1571
+ /// Directionality:
1572
+ ///
1573
+ /// ```
1574
+ /// let s = "English ";
1575
+ /// assert!(Some('E') == s.trim_right().chars().next());
1576
+ ///
1577
+ /// let s = "עברית ";
1578
+ /// assert!(Some('ת') == s.trim_right().chars().next());
1579
+ /// ```
1560
1580
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1561
1581
pub fn trim_right ( & self ) -> & str {
1562
1582
UnicodeStr :: trim_right ( self )
You can’t perform that action at this time.
0 commit comments