Ruby - Regular Expressions
Identify the error in this Ruby code snippet:
sentence = "Hello World!" sentence.gsub(/world/, "Earth")What is the problem?
sentence = "Hello World!" sentence.gsub(/world/, "Earth")What is the problem?
/world/ is lowercase and Ruby regex is case-sensitive by default.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions