Changes

Jump to: navigation, search

Ruby Strings - Creation and Basics

437 bytes added, 19:45, 27 November 2007
Ruby Here Documents
Thank you for your business.
</pre>
 
== Getting Information About String Objects ==
 
The String object includes a number of methods that can be used to obtain information about the string. For example, we can find if a string is empty using the ''empty?'' method:
 
<pre>
myString = ""
=> ""
 
myString.empty?
=> true
</pre>
 
It is also possible to find the length of a string using the ''length'' and ''size'' methods:
 
<pre>
myString = "Hello"
 
myString.length
=> 5
</pre>

Navigation menu