Method: Kernel#gsub
- Defined in:
- string.c
#gsub(pattern, replacement) ⇒ String #gsub(pattern) {|...| ... } ⇒ String
Equivalent to $_.gsub...
, except that $_
receives the modified result.
$_ = "quick brown fox"
gsub /[aeiou]/, '*' #=> "q**ck br*wn f*x"
$_ #=> "q**ck br*wn f*x"
2362 2363 2364 |
# File 'string.c', line 2362 static VALUE rb_f_gsub(argc, argv) int argc; |