Skip to content

Instantly share code, notes, and snippets.

@oneamtu oneamtu/one_line.rb
Created Mar 2, 2013

Embed
What would you like to do?
Eric's refactoring challenge
string.split('.').each_with_index.inject([""]){|a, i| a+[a[i[1]]+"."+i[0]]}.reject(&:empty?).map{|a| a[1..-1]}.join(" && ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.