diff options
| author | BurdetteLamar <burdettelamar@yahoo.com> | 2025-10-24 21:18:40 +0100 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2025-10-24 18:09:54 -0400 |
| commit | fcae206232d923af0de7b0df3917e28f36e116f1 (patch) | |
| tree | be330280910ecd0d9bd491958c686515dec90100 /string.c | |
| parent | 245df86ec3ed30cb844a16b5a4df7e4d91d7c293 (diff) | |
[DOC] Tweaks for String#sub!
Diffstat (limited to 'string.c')
| -rw-r--r-- | string.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -6236,13 +6236,12 @@ rb_pat_search(VALUE pat, VALUE str, long pos, int set_backref_str) * sub!(pattern, replacement) -> self or nil * sub!(pattern) {|match| ... } -> self or nil * - * Replaces the first occurrence (not all occurrences) of the given +pattern+ - * on +self+; returns +self+ if a replacement occurred, +nil+ otherwise. + * Like String#sub, except that: * - * See {Substitution Methods}[rdoc-ref:String@Substitution+Methods]. - * - * Related: String#sub, String#gsub, String#gsub!. + * - Changed are made to +self+, not to copy of +self+. + * - Returns +self+ if any changes are made, +nil+ otherwise. * + * Related: see {Modifying}[rdoc-ref:String@Modifying]. */ static VALUE |
