From f0ac27bfc4f4328fd08aebfff75db04f9b6c92c3 Mon Sep 17 00:00:00 2001 From: Genki Marshall Date: Sat, 15 Nov 2014 13:44:00 -0500 Subject: [PATCH] Document definition of whitespace. Bug #10476 --- string.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/string.c b/string.c index bd03575..3b1342f 100644 --- a/string.c +++ b/string.c @@ -7208,6 +7208,8 @@ lstrip_offset(VALUE str, const char *s, const char *e, rb_encoding *enc) * change was made. See also String#rstrip! and * String#strip!. * + * Refer to strip for the definition of whitespace. + * * " hello ".lstrip #=> "hello " * "hello".lstrip! #=> nil */ @@ -7244,6 +7246,8 @@ rb_str_lstrip_bang(VALUE str) * Returns a copy of str with leading whitespace removed. See also * String#rstrip and String#strip. * + * Refer to strip for the definition of whitespace. + * * " hello ".lstrip #=> "hello " * "hello".lstrip #=> "hello" */ @@ -7328,6 +7332,8 @@ rb_str_rstrip_bang(VALUE str) * Returns a copy of str with trailing whitespace removed. See also * String#lstrip and String#strip. * + * Refer to strip for the definition of whitespace. + * * " hello ".rstrip #=> " hello" * "hello".rstrip #=> "hello" */ @@ -7354,6 +7360,8 @@ rb_str_rstrip(VALUE str) * * Removes leading and trailing whitespace from str. Returns * nil if str was not altered. + * + * Refer to strip for the definition of whitespace. */ static VALUE @@ -7390,9 +7398,13 @@ rb_str_strip_bang(VALUE str) * str.strip -> new_str * * Returns a copy of str with leading and trailing whitespace removed. + * + * Whitespace is defined as any of the following characters: + * null, horizontal tab, line feed, vertical tab, form feed, carriage return, space. * * " hello ".strip #=> "hello" * "\tgoodbye\r\n".strip #=> "goodbye" + * "\x00\t\n\v\f\r ".strip #=> "" */ static VALUE -- 1.8.5.2.msysgit.0