bytes is a String class method in Ruby which is used to return an array of the bytes for the given string.
Parameters: Here, str is the specified string.
Returns: An array of bytes.
83 116 114 105 110 103
65 66 67 68
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.