From: bryan@... Date: 2020-04-11T18:06:16+00:00 Subject: [ruby-core:97833] [Ruby master Feature#16779] Add sprintf %q format option Issue #16779 has been reported by gearnode (Bryan Frimin). ---------------------------------------- Feature #16779: Add sprintf %q format option https://bugs.ruby-lang.org/issues/16779 * Author: gearnode (Bryan Frimin) * Status: Open * Priority: Normal ---------------------------------------- It would be great if sprintf format option for quoted string (like golang sprintf), it's particularly useful to format log for example. Currently we have to do this: ``` ruby sprintf("%s", some_value.inspect.dump) ``` I propose to introduce the `%q` format option which allow to do this: ```ruby sprintf("%q", some_value) ``` ---Files-------------------------------- add-quoted-string-sprintf-format.patch (1.52 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: