summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBurdetteLamar <burdettelamar@yahoo.com>2025-10-24 21:18:40 +0100
committerPeter Zhu <peter@peterzhu.ca>2025-10-24 18:09:54 -0400
commitfcae206232d923af0de7b0df3917e28f36e116f1 (patch)
treebe330280910ecd0d9bd491958c686515dec90100
parent245df86ec3ed30cb844a16b5a4df7e4d91d7c293 (diff)
[DOC] Tweaks for String#sub!
-rw-r--r--string.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/string.c b/string.c
index 824c04a5b2..89445df244 100644
--- a/string.c
+++ b/string.c
@@ -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