Skip to content

Tag Archives: Ruby String-class

inspect is a String class method in Ruby which is used to return a printable version of the given string, surrounded by quote marks, with… Read More
insert is a String class method in Ruby which is used to inserts the specified string before the character at the given index, modifying the… Read More
index is a String class method in Ruby which is used to returns the index of the first occurrence of the given substring or pattern… Read More
include? is a String class method in Ruby which is used to return true if the given string contains the given string or character. Syntax:… Read More
hex is a String class method in Ruby which is used to treats the leading characters from the given string as a string of hexadecimal… Read More
StringIO#bytes() : bytes() is a StringIO class method which returns the value of bytes of the stringIO. Syntax: StringIO.bytes() Parameter: StringIO values Return: value of… Read More
hash is a String class method in Ruby which is used to return a hash based on the string’s length, content and encoding. Syntax: str.hash… Read More
gsub! is a String class method in Ruby which is used to return a copy of the given string with all occurrences of pattern substituted… Read More
gsub is a String class method in Ruby which is used to return a copy of the given string with all occurrences of pattern substituted… Read More
grapheme_clusters is a String class method in Ruby which is used to return an array of grapheme clusters in the given string. Syntax: str.grapheme_clusters Parameters:… Read More
getbyte is a String class method in Ruby which is used to return the indexth byte as an integer. Syntax: str.getbyte(index) Parameters: Here, str is… Read More
eql? is a String class method in Ruby which is used to check whether the strings are equal or not if they have the same… Read More
end_with? is a String class method in Ruby which is used to check if the specified string ends with one of the suffixes given or… Read More
encoding is a String class method in Ruby which is used to return the Encoding object that represents the encoding of object. Syntax: str.encoding Parameters:… Read More
each_line is a String class method in Ruby which is used to split the given string sing the supplied parameter as the record separator ($/… Read More