diff options
author | Holger Just <[email protected]> | 2024-10-07 10:20:03 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2024-10-07 17:20:03 +0900 |
commit | 7081838d2a6b64308161e46296dec5dcea01f789 (patch) | |
tree | 5f4422d95d105da5b96cabf47ffa3886e0ffc91f /string.c | |
parent | 32c733f57bb91e22972319ee63eac9521d954ebc (diff) |
[DOC] String#sub! and String#gsub! return nil if no replacement occured
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/11700
Merged-By: nobu <[email protected]>
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -6092,8 +6092,8 @@ 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 * - * Returns +self+ with only the first occurrence - * (not all occurrences) of the given +pattern+ replaced. + * Replaces the first occurrence (not all occurrences) of the given +pattern+ + * on +self+; returns +self+ if a replacement occurred, +nil+ otherwise. * * See {Substitution Methods}[rdoc-ref:String@Substitution+Methods]. * |