Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: array to hash
Chad Perrin
3/20/2007 8:31:00 PM
On Tue, Mar 20, 2007 at 08:33:09PM +0900, Servando Garcia wrote:
> <html><head><meta name="Generator" content="PSI HTML/CSS Generator"/>
> <style type="text/css"><!--
> body{font-family:'Tahoma';font-size:10pt;font-color:'#000000';}
> LI{display:list-item;margin:0.00in;}
> p{display:block;margin:0.00in;}
> body{}
> --></style>
> </head><BODY ><div><SPAN style="font-family:'Arial';font-size:10pt;">Hello all</SPAN></div>
> <div><SPAN style="font-family:'Arial';font-size:10pt;"> Is there a method to collect the items in an array into a hash</SPAN></div>
> <div> </div>
> <div><SPAN style="font-family:'Arial';font-size:10pt;">I want to go from this X =[1,2,3,4,5,6] to this Y={1 =>2, 3 =>4, 5 =>6}</SPAN></div>
> <div> </div>
> <div><SPAN style="font-family:'Arial';font-size:10pt;">Just seems like there should be one</SPAN></div>
> <div> </div>
> <div><SPAN style="font-family:'Arial';font-size:10pt;">Thanks in advance</SPAN></div>
> <div> </div>
> <div><SPAN style="font-family:'Arial';font-size:10pt;">Sam</SPAN></div>
> </body></html>
>
I'm glad you got the answer you were seeking. I have a request, though:
Please provide plain text email content in the future. Some of us
(intentionally) avoid HTML email.
--
CCD CopyWrite Chad Perrin [
http://ccd.ap...
]
unix virus: If you're using a unixlike OS, please forward
this to 20 others and erase your system partition.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: array to hash
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password