File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -1531,6 +1531,16 @@ impl str {
15311531 ///
15321532 /// assert_eq!("Hello\tworld\t", s.trim_left());
15331533 /// ```
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+ /// ```
15341544 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
15351545 pub fn trim_left ( & self ) -> & str {
15361546 UnicodeStr :: trim_left ( self )
@@ -1557,6 +1567,16 @@ impl str {
15571567 ///
15581568 /// assert_eq!(" Hello\tworld", s.trim_right());
15591569 /// ```
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+ /// ```
15601580 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
15611581 pub fn trim_right ( & self ) -> & str {
15621582 UnicodeStr :: trim_right ( self )
You can’t perform that action at this time.
0 commit comments