diff options
| author | BurdetteLamar <burdettelamar@yahoo.com> | 2025-11-13 14:07:08 +0000 |
|---|---|---|
| committer | Peter Zhu <peter@peterzhu.ca> | 2025-11-13 18:27:43 -0800 |
| commit | 6c7453c5deb76c0be336cedd5eba667e0b6629c6 (patch) | |
| tree | 0902cd577e6b9101c6bfd23928f78b6869f31a46 | |
| parent | 7ea0d369661f9050d29e4a37899cafc8c03d5497 (diff) | |
[DOC] Tweaks for String#tr_s
| -rw-r--r-- | string.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -8964,16 +8964,21 @@ rb_str_tr_s_bang(VALUE str, VALUE src, VALUE repl) /* * call-seq: - * tr_s(selector, replacements) -> string + * tr_s(selector, replacements) -> new_string * - * Like String#tr, but also squeezes the modified portions of the translated string; - * returns a new string (translated and squeezed). + * Like String#tr, except: + * + * - Also squeezes the modified portions of the translated string; + * see String#squeeze. + * - Returns the translated and squeezed string. + * + * Examples: * * 'hello'.tr_s('l', 'r') #=> "hero" * 'hello'.tr_s('el', '-') #=> "h-o" * 'hello'.tr_s('el', 'hx') #=> "hhxo" * - * Related: String#squeeze. + * Related: see {Converting to New String}[rdoc-ref:String@Converting+to+New+String]. * */ |
