Method: String#scrub!
- Defined in:
- string.c
#scrub! ⇒ self #scrub!(replacement_string = default_replacement) ⇒ self #scrub! {|bytes| ... } ⇒ self
Like String#scrub, except that any replacements are made in self.
11796 11797 11798 11799 11800 11801 11802 11803 |
# File 'string.c', line 11796 static VALUE str_scrub_bang(int argc, VALUE *argv, VALUE str) { VALUE repl = argc ? (rb_check_arity(argc, 0, 1), argv[0]) : Qnil; VALUE new = rb_str_scrub(str, repl); if (!NIL_P(new)) rb_str_replace(str, new); return str; } |