diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-25 05:18:39 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-02-25 05:18:39 +0000 |
commit | b27d06d30664c80600f832dd1f6cb653efa8ec1f (patch) | |
tree | 65d967f66566eb43384c2df0fc7c0d21f3211eba /string.c | |
parent | 4e1bea5f5a46ff4c1a067ec280edc5f3da020a3a (diff) |
merge revision(s) 48747: [Backport #10582]
* string.c: [DOC] Add missing documentation around String#chomp.
Patchby @stderr [ci skip][fix GH-780]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@49733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -6817,15 +6817,18 @@ rb_str_chomp_bang(int argc, VALUE *argv, VALUE str) * from the end of <i>str</i> (if present). If <code>$/</code> has not been * changed from the default Ruby record separator, then <code>chomp</code> also * removes carriage return characters (that is it will remove <code>\n</code>, - * <code>\r</code>, and <code>\r\n</code>). - * - * "hello".chomp #=> "hello" - * "hello\n".chomp #=> "hello" - * "hello\r\n".chomp #=> "hello" - * "hello\n\r".chomp #=> "hello\n" - * "hello\r".chomp #=> "hello" - * "hello \n there".chomp #=> "hello \n there" - * "hello".chomp("llo") #=> "he" + * <code>\r</code>, and <code>\r\n</code>). If <code>$/</code> is an empty string, + * it will remove all trailing newlines from the string. + * + * "hello".chomp #=> "hello" + * "hello\n".chomp #=> "hello" + * "hello\r\n".chomp #=> "hello" + * "hello\n\r".chomp #=> "hello\n" + * "hello\r".chomp #=> "hello" + * "hello \n there".chomp #=> "hello \n there" + * "hello".chomp("llo") #=> "he" + * "hello\r\n\r\n".chomp('') #=> "hello" + * "hello\r\n\r\r\n".chomp('') #=> "hello\r\n\r" */ static VALUE |