String# * is a String class method in Ruby which is used to returns a new String containing integer copies of the receiver. Here, integer must be greater than or equal to 0.
Syntax: str * Integer
Parameters: Here, str is the required string and integer is the number of copies.
Returns: This method returns the String containing integer copies of the receiver.
Ruby Ruby Ruby Ruby Hey Hey
Copy Copy Copy Copy Copy
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.