Convert each decimal to its character equivalent with Integer's chr method : each_byte « String « Ruby






Convert each decimal to its character equivalent with Integer's chr method


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

 








Related examples in the same category

1.each_byte takes a string apart byte by byte, returning the decimal value for the character at each index location.
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