gsub(...)
public
Equivalent to $_.gsub…, except that $_
receives the modified result.
$_ = "quick brown fox"
gsub /[aeiou]/, '*'
$_
Show source
/*
* call-seq:
* gsub(pattern, replacement) => string
* gsub(pattern) {|...| block } => string
*
* Equivalent to <code>$_.gsub...</code>, except that <code>$_</code>
* receives the modified result.
*
* $_ = "quick brown fox"
* gsub /[aeiou]/, '*'
* $_
*/
static VALUE
rb_f_gsub(argc, argv)
int argc;
VALUE *argv;
{
VALUE str = rb_str_dup(uscore_get());
if (NIL_P(rb_str_gsub_bang(argc, argv, str)))
return str;
rb_lastline_set(str);
return str;
}