Changes

Ruby String Concatenation and Comparison

2 bytes added, 13:13, 1 December 2007
no edit summary
In the previous chapter ([[Ruby Strings - Creation and Basics]]) we looked at how to create a Ruby string object. In this chapter we will look at acessingaccessing, comparing and concatenating strings in Ruby. In the next chapter we will look at [[Manipulating and Converting Ruby Strings]].
== Concatenating Strings in Ruby ==
</pre>
Still not enough choices for you. ? Well, how about using the ''concat'' method:
<pre>
</pre>
The spaceship (<=>) method can be used to compare two strings in relation to their alphabetical ranking. The <=> method return returns 0 if the strings are identical, -1 if the left hand string is less than the right hand string, and 1 if it is greater:
<pre>