Home
Ruby
ActiveRecord
Array
CGI
Class
Collections
Database
Date
Design Patterns
Development
File Directory
GUI
Hash
Language Basics
Method
Network
Number
Rails
Range
Reflection
Statement
String
Threads
Time
Tk
Unit Test
Windows Platform
XML
Append the output to an array : each_byte « String « Ruby
Ruby
String
each_byte
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