[前][次][番号順一覧][スレッド一覧]

ruby-changes:73848

From: Vaevictusnet <ko1@a...>
Date: Tue, 4 Oct 2022 10:07:27 +0900 (JST)
Subject: [ruby-changes:73848] 7726f6bfff (master): Correcting example for swapcase! method

https://git.ruby-lang.org/ruby.git/commit/?id=7726f6bfff

From 7726f6bfff755f2b43d9138756da8b140ed08da1 Mon Sep 17 00:00:00 2001
From: Vaevictusnet <github.com@v...>
Date: Thu, 29 Sep 2022 13:03:14 -0500
Subject: Correcting example for swapcase! method

Example, line 3, swapcase! was incorrect. implied that the swapcase! did /not/ change the starting string.
---
 string.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/string.c b/string.c
index 78ac5591cc..1fd82595fe 100644
--- a/string.c
+++ b/string.c
@@ -7672,7 +7672,7 @@ rb_str_capitalize(int argc, VALUE *argv, VALUE str) https://github.com/ruby/ruby/blob/trunk/string.c#L7672
  *
  *    s = 'Hello World!' # => "Hello World!"
  *    s.swapcase!        # => "hELLO wORLD!"
- *    s                  # => "Hello World!"
+ *    s                  # => "hELLO wORLD!"
  *    ''.swapcase!       # => nil
  *
  *  The casing may be affected by the given +options+;
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]