Skip to content

Instantly share code, notes, and snippets.

@dchentech
Created April 26, 2011 14:31
Show Gist options
  • Save dchentech/942359 to your computer and use it in GitHub Desktop.
Save dchentech/942359 to your computer and use it in GitHub Desktop.
京东购iphone选号,需求如代码所示
File.read('number.txt').split("\n").select {|str| (str[4] == str[6]) && (str[8] == str[10]) }.reject {|str| str.match(/4/) }.map(&:strip)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment