Ruby - String Operations
What will be the output of this Ruby code?
text = "123-456-789"
result = text.gsub('-', ':')
puts resulttext = "123-456-789"
result = text.gsub('-', ':')
puts resultgsub replaces all occurrences of the pattern, here '-' with ':'.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions