Skip to content

Tag Archives: Ruby String-class

chr is a String class method in Ruby which is used to return a one-character string at the beginning of the string. Syntax:str.chr Parameters: Here,… Read More
chop! is a String class method in Ruby which is used to return a new String with the last character removed. Both characters are removed… Read More
chomp! is a String class method in Ruby which is used to returns new String with the given record separator removed from the end of… Read More
chop is a String class method in Ruby which is used to return a new String with the last character removed. Both characters are removed… Read More
chomp is a String class method in Ruby which is used to returns new String with the given record separator removed from the end of… Read More
chars is a String class method in Ruby which is used to return an array of characters in str. Syntax: str.chars Parameters: Here, str is… Read More
byteslice is a String class method in Ruby which is used for the byte reference. Syntax: str.byteslice Parameters: Here, str is the specified string. Returns:… Read More
===() is a String class method in Ruby which is used to check whether str==obj or not. This method is similar to == method of… Read More
==() is a String class method in Ruby which is used to check whether str==obj or not. Syntax: str == obj Parameters: Here, str is… Read More
bytes is a String class method in Ruby which is used to return an array of the bytes for the given string. Syntax: str.bytes Parameters:… Read More
<=>() is a String class method in Ruby which is used for comparisons of the strings. This method returns -1, 0, +1, or nil depending… Read More
<<() is a String class method in Ruby which is used to append the given object to the string. If the object is an integer,… Read More
+() is a String class method in Ruby which is used to return a new string that contains the other specified string concatenated to the… Read More
String# * is a String class method in Ruby which is used to returns a new String containing integer copies of the receiver. Here, integer… Read More
center is a String class method in Ruby which is used to centers the given string in width. If the specified width is greater than… Read More

Start Your Coding Journey Now!