Ruby - String Operations
Which of the following is the correct syntax to append " world" to the string variable
greeting using << in Ruby?greeting using << in Ruby?<< is used to append text to an existing string variable.greeting << " world" correctly appends " world" to greeting. Other options are either invalid methods or use + which does not modify in place.<< to append text in place [OK]<< to add text directly to string [OK]+ which creates a new stringaddappend which is not standard15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions