summaryrefslogtreecommitdiff
path: root/string.rb
diff options
context:
space:
mode:
Diffstat (limited to 'string.rb')
-rw-r--r--string.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/string.rb b/string.rb
index 1f0e9ceace..941fda0c24 100644
--- a/string.rb
+++ b/string.rb
@@ -29,9 +29,11 @@
# These methods perform substitutions:
#
# - String#sub: One substitution (or none); returns a new string.
-# - String#sub!: One substitution (or none); returns +self+.
+# - String#sub!: One substitution (or none); returns +self+ if any changes,
+# +nil+ otherwise.
# - String#gsub: Zero or more substitutions; returns a new string.
-# - String#gsub!: Zero or more substitutions; returns +self+.
+# - String#gsub!: Zero or more substitutions; returns +self+ if any changes,
+# +nil+ otherwise.
#
# Each of these methods takes:
#