Append the output to an array : each_byte « String « Ruby






Append the output to an array


out = [] 
"myValue".each_byte { |b| p out << b} 
p out

 








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.Convert each decimal to its character equivalent with Integer's chr method
3.each_byte block logics
4.Loop through each byte from a string
5.Use case to deal with special key