document.open();document.writeln('<div onmouseover="document.getElementById(\'snipt-3491\').style.display = \'block\'; return false;" onmouseout="document.getElementById(\'snipt-3491\').style.display = \'none\'; return false;" style="position: relative;">');document.writeln('<div class="highlight"><pre style="-moz-border-radius: 5px; border-radius: 5px; -webkit-border-radius: 5px; margin: 0; display: block; font: 11px Monaco, monospace !important; padding: 15px; background-color: #1C1C1C; overflow: auto; color: #D0D0D0;"><span style="color: #d0d0d0">string.capitalize</span> <span style="color: #999999; font-style: italic"># changes only the first letter of the first word</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39; This is an example &#39;</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">string.upcase</span> <span style="color: #999999; font-style: italic"># downcase can be used for the opposite effect</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39; THIS IS AN EXAMPLE &#39;</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">string.reverse</span> <span style="color: #999999; font-style: italic"># reverses all the letters</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39; elpmaxe na si siht &#39;</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">string.strip</span> <span style="color: #999999; font-style: italic"># strips the white space on the right and left</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39;this is an example&#39;</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">string.rstrip</span> <span style="color: #999999; font-style: italic"># strips the white space on the right</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39; this is an example&#39;</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">string.lstrip</span> <span style="color: #999999; font-style: italic"># strips the white space on the left</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39;this is an example &#39;</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">string.chomp(</span><span style="color: #ed9d13">&#39;example &#39;</span><span style="color: #d0d0d0">)</span> <span style="color: #999999; font-style: italic"># will only work on the end of the string</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39; this is an &#39;</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">string.chop.chop</span> <span style="color: #999999; font-style: italic"># each &quot;chop&quot; will take one character from the end of string</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39; this is an exampl&#39;</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">string.concat(</span><span style="color: #ed9d13">&#39;of string manipulation &#39;</span><span style="color: #d0d0d0">)</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39; this is an example of string manipulation &#39;</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">string</span> <span style="color: #d0d0d0">&lt;&lt;</span> <span style="color: #ed9d13">&#39;of string manipulation &#39;</span> <span style="color: #999999; font-style: italic"># concatenates and changes the object</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39; this is an example of string manipulation &#39;</span>');document.writeln('');document.writeln('<span style="color: #ed9d13">&#39; hey!&#39;</span> <span style="color: #d0d0d0">&lt;&lt;</span> <span style="color: #d0d0d0">string</span> <span style="color: #999999; font-style: italic"># same thing but adding it to the beginning of the string</span>');document.writeln('');document.writeln('<span style="color: #d0d0d0">=&gt;</span> <span style="color: #ed9d13">&#39; hey! this is an example of string manipulation &#39;</span>');document.writeln('</pre></div>');document.writeln('');document.writeln('<div style="background-color: #111; color: #D0D0D0; float: right; padding: 5px 10px; -moz-border-radius-topleft: 5px; -webkit-border-top-left-radius: 5px; border-top-left-radius: 5px; -moz-border-radius-bottomright: 5px; -webkit-border-bottom-right-radius: 5px; border-bottom-right-radius: 5px; font: 11px Arial,Sans-Serif; display: none; position: absolute; bottom: 0; right: 0;" id="snipt-3491">code hosted by <a href="http://snipt.net/ayresnarita/basic-examples-of-string-manipulation-on-ror?key=76ac98e90b95104b1126f59ff7a0cca6" style="color: #0084FF; text-decoration: none;">snipt.net</a></div>');document.writeln('</div>');document.close();