Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
remove element from array
J. mp
2/11/2007 4:43:00 PM
Hi,
how can I do to rtemove an elemnt from an array,
I have this array :
"user"=>{"password_confirmation"=>"", "screen_name"=>"sdfsdfsdfsdf",
"first_name"=>"sdfsdfsd", "last_name"=>"dskkd", "password"=>"",
"email"=>"asdasd@sdksd.cpd"}
And I want to remove the elements "password_confirmation" and
"password".
How should I do this. I found nothing in docs, setting them to nil it's
not an option
thanks
--
Posted via
http://www.ruby-...
.
3 Answers
J. mp
2/11/2007 4:46:00 PM
0
J. mp wrote:
> Hi,
> how can I do to rtemove an elemnt from an array,
>
> I have this array :
> "user"=>{"password_confirmation"=>"", "screen_name"=>"sdfsdfsdfsdf",
> "first_name"=>"sdfsdfsd", "last_name"=>"dskkd", "password"=>"",
> "email"=>"asdasd@sdksd.cpd"}
>
> And I want to remove the elements "password_confirmation" and
> "password".
>
> How should I do this. I found nothing in docs, setting them to nil it's
> not an option
>
> thanks
sorry for making loosing your time. I'm a looser :)
it's from an Hash and not from and array
--
Posted via
http://www.ruby-...
.
dblack
2/11/2007 4:52:00 PM
0
J. mp
2/11/2007 4:59:00 PM
0
unknown wrote:
> Hi --
>
> On Mon, 12 Feb 2007, J. mp wrote:
>
>>> "password".
>>>
>>> How should I do this. I found nothing in docs, setting them to nil it's
>>> not an option
>>>
>>> thanks
>>
>>
>> sorry for making loosing your time. I'm a looser :)
>> it's from an Hash and not from and array
>
> See the docs for Hash#delete, Hash#delete_if, and Hash#reject! (That
> exclamation point is part of the method name.)
>
>
> David
I'm done!
Thanks David
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
remove element from array
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