I think you could just use the String#length method…
http://ruby-doc.org/core-1.9.3/String.html#method-i-length
Example:
text="The quick brown fox jumps over the lazy dog."
puts text.length > 25 ? 'Too many characters' : 'Accepted'
I think you could just use the String#length method…
http://ruby-doc.org/core-1.9.3/String.html#method-i-length
Example:
text="The quick brown fox jumps over the lazy dog."
puts text.length > 25 ? 'Too many characters' : 'Accepted'