Skip to content

Instantly share code, notes, and snippets.

@justinko
Last active May 12, 2017 03:09
def merge_string(a, b)
[a, b].map(&:size).max.times.with_object('') do |(index), output|
[a, b].each {|var| output << (var[index] || '') }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment