From: "naruse (Yui NARUSE)" Date: 2013-10-01T17:05:47+09:00 Subject: [ruby-core:57528] [ruby-trunk - Feature #8573][Feedback] Add String#format method(not an alias of String#%) Issue #8573 has been updated by naruse (Yui NARUSE). Status changed from Open to Feedback Priority changed from Low to Normal Target version changed from current: 2.1.0 to next minor Show concrete use case. ---------------------------------------- Feature #8573: Add String#format method(not an alias of String#%) https://bugs.ruby-lang.org/issues/8573#change-42142 Author: bozhidar (Bozhidar Batsov) Status: Feedback Priority: Normal Assignee: Category: lib Target version: next minor I think it'd be great if String included a method similar to `%` that accepts variable number of arguments (like `sprintf`). This is trivial to implement as you're certainly aware. Here's one implementation suggestion: class String def format(*args) super(self, *(args.flatten)) end end This would make the new method behave both like `sprintf/format` and `String#%`. I think this minor improvement would definitely be in the spirit of making more programmers happy :-) Here a bit more on the topic - http://batsov.com/articles/2013/06/27/the-elements-of-style-in-ruby-number-2-favor-sprintf-format-over-string-number-percent/ -- http://bugs.ruby-lang.org/