capitalize()
public
Returns a copy of str with the first character converted to
uppercase and the remainder to lowercase.
"hello".capitalize
"HELLO".capitalize
"123ABC".capitalize
Show source
/*
* call-seq:
* str.capitalize => new_str
*
* Returns a copy of <i>str</i> with the first character converted to uppercase
* and the remainder to lowercase.
*
* "hello".capitalize
* "HELLO".capitalize
* "123ABC".capitalize
*/
static VALUE
rb_str_capitalize(str)
VALUE str;
{
str = rb_str_dup(str);
rb_str_capitalize_bang(str);
return str;
}