Skip to content

Instantly share code, notes, and snippets.

@igaiga
Created October 19, 2012 07:42
Show Gist options
  • Save igaiga/3916762 to your computer and use it in GitHub Desktop.
Save igaiga/3916762 to your computer and use it in GitHub Desktop.
Array#zip
arr1 = ["1","2","3"]
arr2 = ["1x","2x","3x"]
text = "100"
arr1.zip(arr2) do |x|
text.gsub!(x[0], x[1])
end
p text #=> "1x00"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment