Section 2.5. Processing a Line at a Time


2.4. Finding the Length of a String

The method length can be used to find a string's length. A synonym is size.

str1 = "Carl" x = str1.length     # 4 str2 = "Doyle" x = str2.size       # 5





The Ruby Way(c) Solutions and Techniques in Ruby Programming
The Ruby Way, Second Edition: Solutions and Techniques in Ruby Programming (2nd Edition)
ISBN: 0672328844
EAN: 2147483647
Year: 2004
Pages: 269
Authors: Hal Fulton

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net