Created
February 21, 2019 17:01
-
-
Save jeremycochoy/3e5b8e791e730422c24009fbb9c0f0c4 to your computer and use it in GitHub Desktop.
Split strings back into smaller chunks
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
coordinates = [] | |
word = "" | |
polyline.each_byte do |b| | |
# Add the character b to the current chunk | |
word << b | |
next unless b < 0x5f # While we are below the _ ascii code | |
# Add the chunk to the list of coordinates represented by a string | |
coordinates << word | |
word = "" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment