Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Improve documentation for String #138

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions string.c
Original file line number Diff line number Diff line change
Expand Up @@ -1148,6 +1148,9 @@ rb_str_length(VALUE str)
* str.bytesize -> integer
*
* Returns the length of <i>str</i> in bytes.
*
* "\x80\u3042".bytesize #=> 4
* "hello".bytesize #=> 5
*/

static VALUE
Expand All @@ -1163,6 +1166,7 @@ rb_str_bytesize(VALUE str)
* Returns <code>true</code> if <i>str</i> has a length of zero.
*
* "hello".empty? #=> false
* " ".empty? #=> false
* "".empty? #=> true
*/

Expand Down Expand Up @@ -1210,9 +1214,10 @@ rb_str_plus(VALUE str1, VALUE str2)
* str * integer -> new_str
*
* Copy---Returns a new <code>String</code> containing <i>integer</i> copies of
* the receiver.
* the receiver. <i>integer</i> must be greater than or equal to 0.
*
* "Ho! " * 3 #=> "Ho! Ho! Ho! "
* "Ho! " * 0 #=> ""
*/

VALUE
Expand Down Expand Up @@ -4534,6 +4539,8 @@ rb_str_inspect(VALUE str)
*
* Produces a version of <i>str</i> with all nonprinting characters replaced by
* <code>\nnn</code> notation and all special characters escaped.
*
* "hello \n ''".dump #=> "\"hello \\n ''\"
*/

VALUE
Expand Down Expand Up @@ -7126,7 +7133,7 @@ rb_str_rjust(int argc, VALUE *argv, VALUE str)

/*
* call-seq:
* str.center(integer, padstr) -> new_str
* str.center(integer, padstr='') -> new_str
*
* If <i>integer</i> is greater than the length of <i>str</i>, returns a new
* <code>String</code> of length <i>integer</i> with <i>str</i> centered and
Expand Down