Project

General

Profile

Feature #5361 ยป feature_5361.patch

ayumin (Ayumu AIZAWA), 01/04/2012 07:35 PM

View differences:

string.c
1144 1144
/*
1145 1145
 *  call-seq:
1146 1146
 *     str.bytesize  -> integer
1147
 *     str.byte_size -> integer
1147 1148
 *
1148 1149
 *  Returns the length of <i>str</i> in bytes.
1149 1150
 */
......
4060 4061
/*
4061 4062
 *  call-seq:
4062 4063
 *     str.byteslice(fixnum)           -> new_str or nil
4064
 *     str.byte_slice(fixnum)          -> new_str or nil
4063 4065
 *     str.byteslice(fixnum, fixnum)   -> new_str or nil
4066
 *     str.byte_slice(fixnum, fixnum)  -> new_str or nil
4064 4067
 *     str.byteslice(range)            -> new_str or nil
4068
 *     str.byte_slice(range)           -> new_str or nil
4065 4069
 *
4066 4070
 *  Byte Reference---If passed a single <code>Fixnum</code>, returns a
4067 4071
 *  substring of one byte at that position. If passed two <code>Fixnum</code>
......
7743 7747
    rb_define_method(rb_cString, "length", rb_str_length, 0);
7744 7748
    rb_define_method(rb_cString, "size", rb_str_length, 0);
7745 7749
    rb_define_method(rb_cString, "bytesize", rb_str_bytesize, 0);
7750
    rb_define_method(rb_cString, "byte_size", rb_str_bytesize, 0);
7746 7751
    rb_define_method(rb_cString, "empty?", rb_str_empty, 0);
7747 7752
    rb_define_method(rb_cString, "=~", rb_str_match, 1);
7748 7753
    rb_define_method(rb_cString, "match", rb_str_match_m, -1);
......
7759 7764
    rb_define_method(rb_cString, "getbyte", rb_str_getbyte, 1);
7760 7765
    rb_define_method(rb_cString, "setbyte", rb_str_setbyte, 2);
7761 7766
    rb_define_method(rb_cString, "byteslice", rb_str_byteslice, -1);
7767
    rb_define_method(rb_cString, "byte_slice", rb_str_byteslice, -1);
7762 7768

  
7763 7769
    rb_define_method(rb_cString, "to_i", rb_str_to_i, -1);
7764 7770
    rb_define_method(rb_cString, "to_f", rb_str_to_f, 0);