Created
April 6, 2016 06:26
-
-
Save pashagray/d0cdaed89f51f763e3a62a94958295ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bad_string = 'esdfd((esdf)(esdf' | |
bad_string.split('').each_with_index.map { |char, idx| [char, idx] if char == '(' || char == ')' }.compact | |
#=> [["(", 5], ["(", 6], [")", 11], ["(", 12]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment