Curne) Simon Conrad-Armes
1/11/2005 1:36:00 PM
On 2005 Jan, 11, at 14:16, Christian Knoblauch wrote:
> hello all,
>
> I am trying to convert a string (s="-----boundary with some http
> stuff") to an arry to pass it to http::post as data. I need every
> character in as an extra element (like aX = ["-","-","b","o"....]
the easy way is #split
---------
"abc".split('') # => [ "a", "b", "c" ]
---------
Can't you just write the string to the HTTP thingy, though?
//Curne
>
> I played with unpack(which looks like a good way) but no success.
>
> My last try was this loop but the characters are safed as figures and
> not as characters any more.
>
> s.each_byte do |x|
> aX << x
> end
>
> Thanks a lot!
> best
> Christian
>
>