Created
February 20, 2013 20:59
-
-
Save onpaws/4999562 to your computer and use it in GitHub Desktop.
Ruby .split() while keeping the key in the returned array. in this case the key is a period '.'
This file contains 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
page.css('p').text.split(/(.)/).each_slice(2).map(&:join) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment