Last active
July 12, 2020 13:14
-
-
Save codertcet111/db8d63bbb0d4171b0d801945b29c5a04 to your computer and use it in GitHub Desktop.
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
animal = { | |
'D' => 'dog', | |
'C' => 'cat' | |
} | |
puts 'DC'.gsub(/\w/,animal) | |
# O/P: 'dogcat' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment