mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parent
f801386f0c
commit
0b0ae583f4
Notes:
git
2022-04-04 00:10:05 +09:00
Merged-By: BurdetteLamar <BurdetteLamar@Yahoo.com>
3 changed files with 26 additions and 12 deletions
11
doc/string/bytesize.rdoc
Normal file
11
doc/string/bytesize.rdoc
Normal file
|
@ -0,0 +1,11 @@
|
|||
Returns the count of bytes (not characters) in +self+:
|
||||
|
||||
'foo'.bytesize # => 3
|
||||
'тест'.bytesize # => 8
|
||||
'こんにちは'.bytesize # => 15
|
||||
|
||||
Contrast with String#length:
|
||||
|
||||
'foo'.length # => 3
|
||||
'тест'.length # => 4
|
||||
'こんにちは'.length # => 5
|
13
doc/string/length.rdoc
Normal file
13
doc/string/length.rdoc
Normal file
|
@ -0,0 +1,13 @@
|
|||
Returns the count of characters (not bytes) in +self+:
|
||||
|
||||
'foo'.length # => 3
|
||||
'тест'.length # => 4
|
||||
'こんにちは'.length # => 5
|
||||
|
||||
Contrast with String#bytesize:
|
||||
|
||||
'foo'.bytesize # => 3
|
||||
'тест'.bytesize # => 8
|
||||
'こんにちは'.bytesize # => 15
|
||||
|
||||
String#size is an alias for String#length.
|
14
string.c
14
string.c
|
@ -2115,14 +2115,8 @@ rb_str_strlen(VALUE str)
|
|||
* call-seq:
|
||||
* length -> integer
|
||||
*
|
||||
* Returns the count of characters (not bytes) in +self+:
|
||||
* :include: doc/string/length.rdoc
|
||||
*
|
||||
* "\x80\u3042".length # => 2
|
||||
* "hello".length # => 5
|
||||
*
|
||||
* String#size is an alias for String#length.
|
||||
*
|
||||
* Related: String#bytesize.
|
||||
*/
|
||||
|
||||
VALUE
|
||||
|
@ -2135,12 +2129,8 @@ rb_str_length(VALUE str)
|
|||
* call-seq:
|
||||
* bytesize -> integer
|
||||
*
|
||||
* Returns the count of bytes in +self+:
|
||||
* :include: doc/string/bytesize.rdoc
|
||||
*
|
||||
* "\x80\u3042".bytesize # => 4
|
||||
* "hello".bytesize # => 5
|
||||
*
|
||||
* Related: String#length.
|
||||
*/
|
||||
|
||||
static VALUE
|
||||
|
|
Loading…
Reference in a new issue