From 8f0eb44d93d9950473eeec1b223a1e453ad76223 Mon Sep 17 00:00:00 2001 From: stomar Date: Fri, 26 Oct 2018 20:30:09 +0000 Subject: string.c: improve docs for String#strip and related * string.c: [DOC] improve docs for String#{strip,lstrip,rstrip}{,!}: small clarification, avoid referring to the receiver as `str' (does not appear in the call-seq of the generated HTML docs), enable links for cross-references, simplify rdoc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index f61243d8bb..e654a3023d 100644 --- a/string.c +++ b/string.c @@ -8822,11 +8822,11 @@ lstrip_offset(VALUE str, const char *s, const char *e, rb_encoding *enc) * call-seq: * str.lstrip! -> self or nil * - * Removes leading whitespace from str, returning nil if no - * change was made. See also String#rstrip! and - * String#strip!. + * Removes leading whitespace from the receiver. + * Returns the altered receiver, or +nil+ if no change was made. + * See also String#rstrip! and String#strip!. * - * Refer to strip for the definition of whitespace. + * Refer to String#strip for the definition of whitespace. * * " hello ".lstrip! #=> "hello " * "hello ".lstrip! #=> nil @@ -8862,10 +8862,10 @@ rb_str_lstrip_bang(VALUE str) * call-seq: * str.lstrip -> new_str * - * Returns a copy of str with leading whitespace removed. See also - * String#rstrip and String#strip. + * Returns a copy of the receiver with leading whitespace removed. + * See also String#rstrip and String#strip. * - * Refer to strip for the definition of whitespace. + * Refer to String#strip for the definition of whitespace. * * " hello ".lstrip #=> "hello " * "hello".lstrip #=> "hello" @@ -8912,11 +8912,11 @@ rstrip_offset(VALUE str, const char *s, const char *e, rb_encoding *enc) * call-seq: * str.rstrip! -> self or nil * - * Removes trailing whitespace from str, returning nil if - * no change was made. See also String#lstrip! and - * String#strip!. + * Removes trailing whitespace from the receiver. + * Returns the altered receiver, or +nil+ if no change was made. + * See also String#lstrip! and String#strip!. * - * Refer to strip for the definition of whitespace. + * Refer to String#strip for the definition of whitespace. * * " hello ".rstrip! #=> " hello" * " hello".rstrip! #=> nil @@ -8951,10 +8951,10 @@ rb_str_rstrip_bang(VALUE str) * call-seq: * str.rstrip -> new_str * - * Returns a copy of str with trailing whitespace removed. See also - * String#lstrip and String#strip. + * Returns a copy of the receiver with trailing whitespace removed. + * See also String#lstrip and String#strip. * - * Refer to strip for the definition of whitespace. + * Refer to String#strip for the definition of whitespace. * * " hello ".rstrip #=> " hello" * "hello".rstrip #=> "hello" @@ -8978,12 +8978,12 @@ rb_str_rstrip(VALUE str) /* * call-seq: - * str.strip! -> str or nil + * str.strip! -> self or nil * - * Removes leading and trailing whitespace from str. Returns - * nil if str was not altered. + * Removes leading and trailing whitespace from the receiver. + * Returns the altered receiver, or +nil+ if there was no change. * - * Refer to strip for the definition of whitespace. + * Refer to String#strip for the definition of whitespace. * * " hello ".strip! #=> "hello" * "hello".strip! #=> nil @@ -9022,7 +9022,7 @@ rb_str_strip_bang(VALUE str) * call-seq: * str.strip -> new_str * - * Returns a copy of str with leading and trailing whitespace removed. + * Returns a copy of the receiver 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. -- cgit v1.2.3