How can I get Max Lenght of a Text Field

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

Thanks,

Darin D. 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.

Try this:

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

=> vulture

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs