4 Commits

Author SHA1 Message Date
Yukihiro "Matz" Matsumoto e15738ea74 mruby-sprintf: add comprehensive call-seq documentation for String#% method
- %: string formatting operator that uses the string as a format specification
  and applies it to the given argument(s), supports both single arguments and
  arrays for multiple substitutions, delegates to sprintf for actual formatting

The method now has comprehensive call-seq documentation with practical
examples demonstrating various sprintf formatting patterns including:

- Zero-padded integers: "%05d" % 123
- Multiple substitutions with arrays: "%-5s: %016x" % [name, id]
- Hash-based named substitutions: "foo = %{foo}" % { :foo => 'bar' }
- Named format specifiers: "%{foo}f" % { :foo => 1 }

Co-authored-by: Atlassian Rovo Dev
2025-08-14 10:52:47 +09:00
Yukihiro "Matz" Matsumoto c3ed6e3d25 use is_a? Array for String#% argument check as the original PR did in #2349 2014-06-04 09:08:22 +09:00
Yukihiro "Matz" Matsumoto 4380f86150 Special treatment for Hashes, not Arrays; ref #2349 2014-06-03 16:33:30 +09:00
Tomoyuki Sahara fe9f3fdd20 add 'String#%'. 2014-06-03 16:31:20 +09:00