Created
October 8, 2021 15:15
-
-
Save cesartalves/cbf06a891d49d95f0cfd23aafbf182d1 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
string = '1,2,3,4,5,6' | |
number = true | |
string.chars.each do |char| | |
if number && char.number? # pseudo-code | |
number = false | |
continue | |
else | |
if char.comma? | |
number = true | |
continue | |
end | |
raise "Nao seque o padrao" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment