<<() is a String class method in Ruby which is used to append the given object to the string. If the object is an integer, then by default it is considered a codepoint and converted to a character before being appended.
Syntax: str << "object"
Parameters: Here, str is the specified string and object is appended to the string.
Returns: Appended string.
Hey Champ Kirti !
Ruby String Hello Geeks!
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.