mirror of
https://github.com/ruby/ruby.git
synced 2025-09-16 00:54:01 +02:00
merges r29254 from trunk into ruby_1_9_2.
-- * string.c (rb_str_times): mentioned about Hash argument. a patch from Daniel Bovensiepen at [ruby-core:32386]. * sprintf.c (get_hash): ditto, and fix typo. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@29797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
33ed9f92ba
commit
c2a3a47f40
4 changed files with 15 additions and 7 deletions
|
@ -422,13 +422,13 @@ get_hash(volatile VALUE *hash, int argc, const VALUE *argv)
|
|||
* sprintf("%u", -123) #=> "-123"
|
||||
*
|
||||
* For more complex formatting, Ruby supports a reference by name.
|
||||
* %<name>s style uses format style, but ${name} style doesn't.
|
||||
* %<name>s style uses format style, but %{name} style doesn't.
|
||||
*
|
||||
* Exapmles:
|
||||
* sprintf("%<foo>d : %<bar>f" % { :foo => 1, :bar => 2 })
|
||||
* #=> 1 : 2.000000
|
||||
* sprintf("%d %{foo}" % { :foo => 'bar' })
|
||||
* # => "%d bar"
|
||||
* sprintf("%{foo}f" % { :foo => 1 })
|
||||
* # => "1f"
|
||||
*/
|
||||
|
||||
VALUE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue