Method: Kernel#sub

Defined in:
string.c

#sub(pattern, replacement) ⇒ Object #sub(pattern) { ... } ⇒ Object

Equivalent to $_.sub(<i>args</i>), except that $_ will be updated if substitution occurs.

Overloads:

  • #sub(pattern) { ... } ⇒ Object

    Yields:



2315
2316
2317
# File 'string.c', line 2315

static VALUE
rb_f_sub(argc, argv)
int argc;