diff options
author | Kazuhiro NISHIYAMA <[email protected]> | 2021-09-23 09:20:00 +0900 |
---|---|---|
committer | Kazuhiro NISHIYAMA <[email protected]> | 2021-09-23 09:20:00 +0900 |
commit | e0c6e8c64ac3d7cf05a40acacb36dc60924af897 (patch) | |
tree | de33f785ff1bb34a9eec40ff17aeee4ad8789305 /string.c | |
parent | fb976df81f99bb4505179ec02a74ece6cb6ffeee (diff) |
[DOC] Use `unpack1` instead of `unpack(template)[0]` [ci skip]
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -10831,7 +10831,7 @@ enc_str_scrub(rb_encoding *enc, VALUE str, VALUE repl, int cr) * * "abc\u3042\x81".scrub #=> "abc\u3042\uFFFD" * "abc\u3042\x81".scrub("*") #=> "abc\u3042*" - * "abc\u3042\xE3\x80".scrub{|bytes| '<'+bytes.unpack('H*')[0]+'>' } #=> "abc\u3042<e380>" + * "abc\u3042\xE3\x80".scrub{|bytes| '<'+bytes.unpack1('H*')+'>' } #=> "abc\u3042<e380>" */ static VALUE str_scrub(int argc, VALUE *argv, VALUE str) @@ -10853,7 +10853,7 @@ str_scrub(int argc, VALUE *argv, VALUE str) * * "abc\u3042\x81".scrub! #=> "abc\u3042\uFFFD" * "abc\u3042\x81".scrub!("*") #=> "abc\u3042*" - * "abc\u3042\xE3\x80".scrub!{|bytes| '<'+bytes.unpack('H*')[0]+'>' } #=> "abc\u3042<e380>" + * "abc\u3042\xE3\x80".scrub!{|bytes| '<'+bytes.unpack1('H*')+'>' } #=> "abc\u3042<e380>" */ static VALUE str_scrub_bang(int argc, VALUE *argv, VALUE str) |