From: ts Date: 2003-06-22T22:01:59+09:00 Subject: Re: String#decorate >>>>> "M" == Martin DeMello writes: M> pp = ary.join(",").decorate {|s| "[#{s}]"} M> attrib = title.capitalize.decorate {|t| "\t -- #{author[t]},\"#{t}\""} M> (n*100).to_s.decorate {|p| "#{p}% done"} Something like this ? svg% ri String#% --------------------------------------------------------------- String#% str % arg -> aString ------------------------------------------------------------------------ Format---Uses str as a format specification, and returns the result of applying it to arg. If the format specification contains more than one substitution, then arg must be an Array containing the values to be substituted. See Kernel::sprintf on page 427 for details of the format string. "%05d" % 123 #=> "00123" "%-5s: %08x" % [ "ID", self.id ] #=> "ID : 200e0648" svg% Guy Decoux