Ruby - String Operations
What is the main difference between
+ and << when used with strings in Ruby?+ and << when used with strings in Ruby?+ behavior+ operator joins two strings but returns a new string without changing the original.<< behavior<< operator appends text directly to the original string, modifying it in place.+ creates a new string, << modifies the original string. -> Option A+ new string, << modifies original [OK]+ new string, << changes original [OK]+ changes the original string<< with creating a new string15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions