diff --git a/string.c b/string.c index e93af5ceceb4ba..97c13b58ae748d 100644 --- a/string.c +++ b/string.c @@ -4995,10 +4995,12 @@ rb_str_include(VALUE str, VALUE arg) * str.to_i(base=10) -> integer * * Returns the result of interpreting leading characters in str as an - * integer base base (between 2 and 36). Extraneous characters past the - * end of a valid number are ignored. If there is not a valid number at the - * start of str, 0 is returned. This method never raises an - * exception when base is valid. + * integer base base (either 0 or between 2 and 36). If a base of 0 is + * passed, radix indicators ('0b', '0o', '0d', '0x') at the beginning of the + * string will be honored. Extraneous characters past the end of a valid number + * are ignored. If there is not a valid number at the start of str, + * 0 is returned. This method never raises an exception when + * base is valid. * * "12345".to_i #=> 12345 * "99 red balloons".to_i #=> 99