about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/str.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 285b6114957..d7d33b5528b 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -2195,6 +2195,16 @@ impl &str: StrSlice {
     #[inline]
     fn escape_unicode() -> ~str { escape_unicode(self) }
 
+    /// Returns a string with leading and trailing whitespace removed
+    #[inline]
+    fn trim() -> ~str { trim(self) }
+    /// Returns a string with leading whitespace removed
+    #[inline]
+    fn trim_left() -> ~str { trim_left(self) }
+    /// Returns a string with trailing whitespace removed
+    #[inline]
+    fn trim_right() -> ~str { trim_right(self) }
+
     #[inline]
     pure fn to_unique() -> ~str { self.slice(0, self.len()) }