[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

How can I get Max Lenght of a Text Field

Darin Duphorn

2/1/2008 8:35:00 PM



Blah = $ie.text_field(:name,$developer_name).MaxLenght()
puts Blah

Thanks,
--
Posted via http://www.ruby-....

2 Answers

Darin Duphorn

2/1/2008 8:43:00 PM

0

Darin Duphorn wrote:
>
>
> Blah = $ie.text_field(:name,$developer_name).MaxLenght()
> puts Blah
>
> Thanks,

You so close.

First spell Length correctly ("Lenght")
Next it should be maxLenght() instead of MaxLenght

Hope that help, dummy.
--
Posted via http://www.ruby-....

Lloyd Linklater

2/2/2008 6:45:00 AM

0

Try this:

a = %w(cat mule tiger vulture)
puts a.max {|a, b| a.length <=> b.length}

=> vulture
--
Posted via http://www.ruby-....