Skip to content

Commit

Permalink
* string.c: improve docs for String#strip and variations. [ruby-core:…
Browse files Browse the repository at this point in the history
…66081][Bug ruby#10476]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
ayumin committed Jan 4, 2015
1 parent cf0006e commit 6abaf76
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
Sun Jan 4 12:24:11 2015 Ayumu AIZAWA <[email protected]>

* string.c: improve docs for String#strip and variations.
[ruby-core:66081][Bug #10476]

Sun Jan 4 09:21:04 2015 SHIBATA Hiroshi <[email protected]>

* lib/drb/drb.rb: removed unused argument. Patch by @vipulnsward
Expand Down
14 changes: 14 additions & 0 deletions string.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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"
*/
Expand Down Expand Up @@ -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
*/
Expand Down Expand Up @@ -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"
*/
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6abaf76

Please sign in to comment.