[HELP] Single questions & Help Thread [n00b] (66)

58 Name: #!/usr/bin/anonymous : 2008-09-05 08:21 ID:wncl2fNG

So i just read through some basic tutorials on Ruby and I'm trying to get the following to work with my laziness, limited Ruby and general programming knowledge.
I basically have a hex string that looks like "0x0011223344..." and I want to cut out every byte/2 hex values into an array where I then append a "%" before every byte so I can decode it in another program (I know this is probably possible with Ruby itself).
Thats what I've got so far:

*x = "0x11223344"*
*a = 0*
*e = 1*
*y = [x.slice(a..e)]*

Now how I thought about looping that and incrementing a, and e, in each loop, but this will only get y[0] filled. How do I loop it so that the entire content of x is put into the y[] array byte by byte?

This thread has been closed. You cannot post in this thread any longer.