Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
string = "This is a Ruby tutorial."
# Here we will return an array containing each instance of i
string.scan('i')
# This code returns ["i", "i", "i"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment