Ruby - Regular Expressions
Find the mistake in this code:
str = "abc123" str.gsub(/\d+/, '#') puts str
str = "abc123" str.gsub(/\d+/, '#') puts str
gsub behaviorgsub returns a new string and does not change the original string unless gsub! is used.str is unchanged, puts str prints the original string.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions