summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-04 03:37:10 +0000
committerayumin <ayumin@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-04 03:37:10 +0000
commit6abaf7646341c474749baba6de3c321349a5b993 (patch)
tree259f4ee652526f1c7884b8fe091f923614d47623 /string.c
parentcf0006ea2ba60cf3cc6eb81bfcd40eccecf344af (diff)
* string.c: improve docs for String#strip and variations. [ruby-core:66081][Bug #10476]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/string.c b/string.c
index 9053835ee2..13c89b167b 100644
--- a/string.c
+++ b/string.c
@@ -7281,6 +7281,8 @@ lstrip_offset(VALUE str, const char *s, const char *e, rb_encoding *enc)
* change was made. See also <code>String#rstrip!</code> and
* <code>String#strip!</code>.
*
+ * Refer to <code>strip</code> for the definition of whitespace.
+ *
* " hello ".lstrip #=> "hello "
* "hello".lstrip! #=> nil
*/
@@ -7317,6 +7319,8 @@ rb_str_lstrip_bang(VALUE str)
* Returns a copy of <i>str</i> with leading whitespace removed. See also
* <code>String#rstrip</code> and <code>String#strip</code>.
*
+ * Refer to <code>strip</code> for the definition of whitespace.
+ *
* " hello ".lstrip #=> "hello "
* "hello".lstrip #=> "hello"
*/
@@ -7366,6 +7370,8 @@ rstrip_offset(VALUE str, const char *s, const char *e, rb_encoding *enc)
* no change was made. See also <code>String#lstrip!</code> and
* <code>String#strip!</code>.
*
+ * Refer to <code>strip</code> for the definition of whitespace.
+ *
* " hello ".rstrip #=> " hello"
* "hello".rstrip! #=> nil
*/
@@ -7401,6 +7407,8 @@ rb_str_rstrip_bang(VALUE str)
* Returns a copy of <i>str</i> with trailing whitespace removed. See also
* <code>String#lstrip</code> and <code>String#strip</code>.
*
+ * Refer to <code>strip</code> for the definition of whitespace.
+ *
* " hello ".rstrip #=> " hello"
* "hello".rstrip #=> "hello"
*/
@@ -7427,6 +7435,8 @@ rb_str_rstrip(VALUE str)
*
* Removes leading and trailing whitespace from <i>str</i>. Returns
* <code>nil</code> if <i>str</i> was not altered.
+ *
+ * Refer to <code>strip</code> for the definition of whitespace.
*/
static VALUE
@@ -7464,8 +7474,12 @@ rb_str_strip_bang(VALUE str)
*
* Returns a copy of <i>str</i> 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