swapcase()
public
Returns a copy of str with uppercase alphabetic characters
converted to lowercase and lowercase characters converted to uppercase.
"Hello".swapcase
"cYbEr_PuNk11".swapcase
Show source
/*
* call-seq:
* str.swapcase => new_str
*
* Returns a copy of <i>str</i> with uppercase alphabetic characters converted
* to lowercase and lowercase characters converted to uppercase.
*
* "Hello".swapcase
* "cYbEr_PuNk11".swapcase
*/
static VALUE
rb_str_swapcase(str)
VALUE str;
{
str = rb_str_dup(str);
rb_str_swapcase_bang(str);
return str;
}