Order disjoint list items: Difference between revisions
m
→sprintf version: Add comment
m (→sprintf version: space) |
m (→sprintf version: Add comment) |
||
Line 2,176:
nn = n.split
nn.each {|item| mm.sub!(item, "%s")} #sub! only subs the first match
mm % nn #"the %s sat on the %s" % [mat", "cat"] #does what you hope it does.
end
|