@@ -313,7 +313,7 @@ pub fn unshift_char(s: &mut ~str, ch: char) {
313313 * * chars_to_trim - A vector of chars
314314 *
315315 */
316- pub pure fn trim_left_chars_DBGBRWD ( s : & ' a str , chars_to_trim : & [ char ] ) -> & ' a str {
316+ pub pure fn trim_left_chars ( s : & ' a str , chars_to_trim : & [ char ] ) -> & ' a str {
317317 if chars_to_trim. is_empty ( ) { return s; }
318318
319319 match find ( s, |c| !chars_to_trim. contains ( & c) ) {
@@ -331,7 +331,7 @@ pub pure fn trim_left_chars_DBGBRWD(s: &'a str, chars_to_trim: &[char]) -> &'a s
331331 * * chars_to_trim - A vector of chars
332332 *
333333 */
334- pub pure fn trim_right_chars_DBGBRWD ( s : & ' a str , chars_to_trim : & [ char ] ) -> & ' a str {
334+ pub pure fn trim_right_chars ( s : & ' a str , chars_to_trim : & [ char ] ) -> & ' a str {
335335 if chars_to_trim. is_empty ( ) { return s; }
336336
337337 match rfind ( s, |c| !chars_to_trim. contains ( & c) ) {
@@ -352,20 +352,20 @@ pub pure fn trim_right_chars_DBGBRWD(s: &'a str, chars_to_trim: &[char]) -> &'a
352352 * * chars_to_trim - A vector of chars
353353 *
354354 */
355- pub pure fn trim_chars_DBGBRWD ( s : & ' a str , chars_to_trim : & [ char ] ) -> & ' a str {
356- trim_left_chars_DBGBRWD ( trim_right_chars_DBGBRWD ( s, chars_to_trim) , chars_to_trim)
355+ pub pure fn trim_chars ( s : & ' a str , chars_to_trim : & [ char ] ) -> & ' a str {
356+ trim_left_chars ( trim_right_chars ( s, chars_to_trim) , chars_to_trim)
357357}
358358
359359/// Returns a string with leading whitespace removed
360- pub pure fn trim_left_DBGBRWD ( s : & ' a str ) -> & ' a str {
360+ pub pure fn trim_left ( s : & ' a str ) -> & ' a str {
361361 match find ( s, |c| !char:: is_whitespace ( c) ) {
362362 None => "" ,
363363 Some ( first) => unsafe { raw:: slice_bytes ( s, first, len ( s) ) }
364364 }
365365}
366366
367367/// Returns a string with trailing whitespace removed
368- pub pure fn trim_right_DBGBRWD ( s : & ' a str ) -> & ' a str {
368+ pub pure fn trim_right ( s : & ' a str ) -> & ' a str {
369369 match rfind ( s, |c| !char:: is_whitespace ( c) ) {
370370 None => "" ,
371371 Some ( last) => {
@@ -376,7 +376,7 @@ pub pure fn trim_right_DBGBRWD(s: &'a str) -> &'a str {
376376}
377377
378378/// Returns a string with leading and trailing whitespace removed
379- pub pure fn trim_DBGBRWD ( s : & ' a str ) -> & ' a str { trim_left_DBGBRWD ( trim_right_DBGBRWD ( s) ) }
379+ pub pure fn trim ( s : & ' a str ) -> & ' a str { trim_left ( trim_right ( s) ) }
380380
381381/*
382382Section: Transforming strings
@@ -421,7 +421,7 @@ pub pure fn chars(s: &str) -> ~[char] {
421421 * Returns a string containing `n` characters starting at byte offset
422422 * `begin`.
423423 */
424- pub pure fn substr_DBGBRWD ( s : & ' a str , begin : uint , n : uint ) -> & ' a str {
424+ pub pure fn substr ( s : & ' a str , begin : uint , n : uint ) -> & ' a str {
425425 slice ( s, begin, begin + count_bytes ( s, begin, n) )
426426}
427427
@@ -2275,17 +2275,17 @@ pub trait StrSlice {
22752275 pure fn split_char(&self, sep: char) -> ~[~str];
22762276 pure fn split_str(&self, sep: &'a str) -> ~[~str];
22772277 pure fn starts_with(&self, needle: &'a str) -> bool;
2278- pure fn substr_DBGBRWD (&self, begin: uint, n: uint) -> &'self str;
2278+ pure fn substr (&self, begin: uint, n: uint) -> &'self str;
22792279 pure fn to_lower(&self) -> ~str;
22802280 pure fn to_upper(&self) -> ~str;
22812281 pure fn escape_default(&self) -> ~str;
22822282 pure fn escape_unicode(&self) -> ~str;
2283- pure fn trim_DBGBRWD (&self) -> &'self str;
2284- pure fn trim_left_DBGBRWD (&self) -> &'self str;
2285- pure fn trim_right_DBGBRWD (&self) -> &'self str;
2286- pure fn trim_chars_DBGBRWD (&self, chars_to_trim: &[char]) -> &'self str;
2287- pure fn trim_left_chars_DBGBRWD (&self, chars_to_trim: &[char]) -> &'self str;
2288- pure fn trim_right_chars_DBGBRWD (&self, chars_to_trim: &[char]) -> &'self str;
2283+ pure fn trim (&self) -> &'self str;
2284+ pure fn trim_left (&self) -> &'self str;
2285+ pure fn trim_right (&self) -> &'self str;
2286+ pure fn trim_chars (&self, chars_to_trim: &[char]) -> &'self str;
2287+ pure fn trim_left_chars (&self, chars_to_trim: &[char]) -> &'self str;
2288+ pure fn trim_right_chars (&self, chars_to_trim: &[char]) -> &'self str;
22892289 pure fn to_owned(&self) -> ~str;
22902290 pure fn to_managed(&self) -> @str;
22912291 pure fn char_at(&self, i: uint) -> char;
@@ -2419,8 +2419,8 @@ impl StrSlice for &'self str {
24192419 * `begin`.
24202420 */
24212421 #[inline]
2422- pure fn substr_DBGBRWD (&self, begin: uint, n: uint) -> &'self str {
2423- substr_DBGBRWD (*self, begin, n)
2422+ pure fn substr (&self, begin: uint, n: uint) -> &'self str {
2423+ substr (*self, begin, n)
24242424 }
24252425 /// Convert a string to lowercase
24262426 #[inline]
@@ -2437,25 +2437,25 @@ impl StrSlice for &'self str {
24372437
24382438 /// Returns a string with leading and trailing whitespace removed
24392439 #[inline]
2440- pure fn trim_DBGBRWD (&self) -> &'self str { trim_DBGBRWD (*self) }
2440+ pure fn trim (&self) -> &'self str { trim (*self) }
24412441 /// Returns a string with leading whitespace removed
24422442 #[inline]
2443- pure fn trim_left_DBGBRWD (&self) -> &'self str { trim_left_DBGBRWD (*self) }
2443+ pure fn trim_left (&self) -> &'self str { trim_left (*self) }
24442444 /// Returns a string with trailing whitespace removed
24452445 #[inline]
2446- pure fn trim_right_DBGBRWD (&self) -> &'self str { trim_right_DBGBRWD (*self) }
2446+ pure fn trim_right (&self) -> &'self str { trim_right (*self) }
24472447
24482448 #[inline]
2449- pure fn trim_chars_DBGBRWD (&self, chars_to_trim: &[char]) -> &'self str {
2450- trim_chars_DBGBRWD (*self, chars_to_trim)
2449+ pure fn trim_chars (&self, chars_to_trim: &[char]) -> &'self str {
2450+ trim_chars (*self, chars_to_trim)
24512451 }
24522452 #[inline]
2453- pure fn trim_left_chars_DBGBRWD (&self, chars_to_trim: &[char]) -> &'self str {
2454- trim_left_chars_DBGBRWD (*self, chars_to_trim)
2453+ pure fn trim_left_chars (&self, chars_to_trim: &[char]) -> &'self str {
2454+ trim_left_chars (*self, chars_to_trim)
24552455 }
24562456 #[inline]
2457- pure fn trim_right_chars_DBGBRWD (&self, chars_to_trim: &[char]) -> &'self str {
2458- trim_right_chars_DBGBRWD (*self, chars_to_trim)
2457+ pure fn trim_right_chars (&self, chars_to_trim: &[char]) -> &'self str {
2458+ trim_right_chars (*self, chars_to_trim)
24592459 }
24602460
24612461
@@ -2817,11 +2817,11 @@ mod tests {
28172817 #[ test]
28182818 fn test_substr( ) {
28192819 fn t( a: & str , b: & str , start: int) {
2820- fail_unless!( substr_DBGBRWD ( a, start as uint, len( b) ) == b) ;
2820+ fail_unless!( substr ( a, start as uint, len( b) ) == b) ;
28212821 }
28222822 t( "hello", "llo", 2 ) ;
28232823 t( "hello", "el", 1 ) ;
2824- fail_unless!( "ะเทศไท" == substr_DBGBRWD ( "ประเทศไทย中华Việt Nam ", 6 u, 6 u) ) ;
2824+ fail_unless!( "ะเทศไท" == substr ( "ประเทศไทย中华Việt Nam ", 6 u, 6 u) ) ;
28252825 }
28262826
28272827 #[ test]
@@ -3054,62 +3054,62 @@ mod tests {
30543054
30553055 #[ test]
30563056 fn test_trim_left_chars( ) {
3057- fail_unless!( trim_left_chars_DBGBRWD ( " * * * foo * * * ", ~[ ] ) ==
3057+ fail_unless!( trim_left_chars ( " * * * foo * * * ", ~[ ] ) ==
30583058 " * * * foo * * * ") ;
3059- fail_unless!( trim_left_chars_DBGBRWD ( " * * * foo * * * ", ~[ '*' , ' ' ] ) ==
3059+ fail_unless!( trim_left_chars ( " * * * foo * * * ", ~[ '*' , ' ' ] ) ==
30603060 "foo * * * ") ;
3061- fail_unless!( trim_left_chars_DBGBRWD ( " * * * * * * ", ~[ '*' , ' ' ] ) == "") ;
3062- fail_unless!( trim_left_chars_DBGBRWD ( "foo * * * ", ~[ '*' , ' ' ] ) ==
3061+ fail_unless!( trim_left_chars ( " * * * * * * ", ~[ '*' , ' ' ] ) == "") ;
3062+ fail_unless!( trim_left_chars ( "foo * * * ", ~[ '*' , ' ' ] ) ==
30633063 "foo * * * ") ;
30643064 }
30653065
30663066 #[ test]
30673067 fn test_trim_right_chars( ) {
3068- fail_unless!( trim_right_chars_DBGBRWD ( " * * * foo * * * ", ~[ ] ) ==
3068+ fail_unless!( trim_right_chars ( " * * * foo * * * ", ~[ ] ) ==
30693069 " * * * foo * * * ") ;
3070- fail_unless!( trim_right_chars_DBGBRWD ( " * * * foo * * * ", ~[ '*' , ' ' ] ) ==
3070+ fail_unless!( trim_right_chars ( " * * * foo * * * ", ~[ '*' , ' ' ] ) ==
30713071 " * * * foo") ;
3072- fail_unless!( trim_right_chars_DBGBRWD ( " * * * * * * ", ~[ '*' , ' ' ] ) == "") ;
3073- fail_unless!( trim_right_chars_DBGBRWD ( " * * * foo", ~[ '*' , ' ' ] ) ==
3072+ fail_unless!( trim_right_chars ( " * * * * * * ", ~[ '*' , ' ' ] ) == "") ;
3073+ fail_unless!( trim_right_chars ( " * * * foo", ~[ '*' , ' ' ] ) ==
30743074 " * * * foo") ;
30753075 }
30763076
30773077 #[ test]
30783078 fn test_trim_chars( ) {
3079- fail_unless!( trim_chars_DBGBRWD ( " * * * foo * * * ", ~[ ] ) == " * * * foo * * * ") ;
3080- fail_unless!( trim_chars_DBGBRWD ( " * * * foo * * * ", ~[ '*' , ' ' ] ) == "foo") ;
3081- fail_unless!( trim_chars_DBGBRWD ( " * * * * * * ", ~[ '*' , ' ' ] ) == "") ;
3082- fail_unless!( trim_chars_DBGBRWD ( "foo", ~[ '*' , ' ' ] ) == "foo") ;
3079+ fail_unless!( trim_chars ( " * * * foo * * * ", ~[ ] ) == " * * * foo * * * ") ;
3080+ fail_unless!( trim_chars ( " * * * foo * * * ", ~[ '*' , ' ' ] ) == "foo") ;
3081+ fail_unless!( trim_chars ( " * * * * * * ", ~[ '*' , ' ' ] ) == "") ;
3082+ fail_unless!( trim_chars ( "foo", ~[ '*' , ' ' ] ) == "foo") ;
30833083 }
30843084
30853085 #[ test]
30863086 fn test_trim_left( ) {
3087- fail_unless!( ( trim_left_DBGBRWD ( "") == "") ) ;
3088- fail_unless!( ( trim_left_DBGBRWD ( "a") == "a") ) ;
3089- fail_unless!( ( trim_left_DBGBRWD ( " ") == "") ) ;
3090- fail_unless!( ( trim_left_DBGBRWD ( " blah") == "blah") ) ;
3091- fail_unless!( ( trim_left_DBGBRWD ( " \u3000 wut") == "wut") ) ;
3092- fail_unless!( ( trim_left_DBGBRWD ( "hey ") == "hey ") ) ;
3087+ fail_unless!( ( trim_left ( "") == "") ) ;
3088+ fail_unless!( ( trim_left ( "a") == "a") ) ;
3089+ fail_unless!( ( trim_left ( " ") == "") ) ;
3090+ fail_unless!( ( trim_left ( " blah") == "blah") ) ;
3091+ fail_unless!( ( trim_left ( " \u3000 wut") == "wut") ) ;
3092+ fail_unless!( ( trim_left ( "hey ") == "hey ") ) ;
30933093 }
30943094
30953095 #[ test]
30963096 fn test_trim_right( ) {
3097- fail_unless!( ( trim_right_DBGBRWD ( "") == "") ) ;
3098- fail_unless!( ( trim_right_DBGBRWD ( "a") == "a") ) ;
3099- fail_unless!( ( trim_right_DBGBRWD ( " ") == "") ) ;
3100- fail_unless!( ( trim_right_DBGBRWD ( "blah ") == "blah") ) ;
3101- fail_unless!( ( trim_right_DBGBRWD ( "wut \u3000 ") == "wut") ) ;
3102- fail_unless!( ( trim_right_DBGBRWD ( " hey") == " hey") ) ;
3097+ fail_unless!( ( trim_right ( "") == "") ) ;
3098+ fail_unless!( ( trim_right ( "a") == "a") ) ;
3099+ fail_unless!( ( trim_right ( " ") == "") ) ;
3100+ fail_unless!( ( trim_right ( "blah ") == "blah") ) ;
3101+ fail_unless!( ( trim_right ( "wut \u3000 ") == "wut") ) ;
3102+ fail_unless!( ( trim_right ( " hey") == " hey") ) ;
31033103 }
31043104
31053105 #[ test]
31063106 fn test_trim( ) {
3107- fail_unless!( ( trim_DBGBRWD ( "") == "") ) ;
3108- fail_unless!( ( trim_DBGBRWD ( "a") == "a") ) ;
3109- fail_unless!( ( trim_DBGBRWD ( " ") == "") ) ;
3110- fail_unless!( ( trim_DBGBRWD ( " blah ") == "blah") ) ;
3111- fail_unless!( ( trim_DBGBRWD ( "\n wut \u3000 ") == "wut") ) ;
3112- fail_unless!( ( trim_DBGBRWD ( " hey dude ") == "hey dude") ) ;
3107+ fail_unless!( ( trim ( "") == "") ) ;
3108+ fail_unless!( ( trim ( "a") == "a") ) ;
3109+ fail_unless!( ( trim ( " ") == "") ) ;
3110+ fail_unless!( ( trim ( " blah ") == "blah") ) ;
3111+ fail_unless!( ( trim ( "\n wut \u3000 ") == "wut") ) ;
3112+ fail_unless!( ( trim ( " hey dude ") == "hey dude") ) ;
31133113 }
31143114
31153115 #[ test]
0 commit comments