Changes

Jump to: navigation, search

Ruby String Conversions

5 bytes added, 13:18, 1 December 2007
no edit summary
</pre>
This has created an array object called myArray. Unfortunately this isn't much use to use us because we wanted each character in our string to be placed in a individual array element. To do this we need to specify a regular expression. In this case we need to use the regular expression which represents the point between two characters (//) and pass it through as an argument to the ''split'' method:
<pre>
== Changing the Case of a Ruby String ==
The first letter of a string (and only the first letter of a string) can be capitalized using the ''capitalize'' and ''capitalize!'' methods (the first returns a modified string, the second changes the original string):
<pre>

Navigation menu