each_byte takes a string apart byte by byte, returning the decimal value for the character at each index location. : each_byte « String « Ruby






each_byte takes a string apart byte by byte, returning the decimal value for the character at each index location.


"myValue".each_byte { |b| print b, "/" }

 








Related examples in the same category

1.Convert each decimal to its character equivalent with Integer's chr method
2.Append the output to an array
3.each_byte block logics
4.Loop through each byte from a string
5.Use case to deal with special key