I know this is simple, but how do you take a string and convert it to lower case, or upper case in ruby.
I found the answer, but it took me way too long, it is better here...
Heat Miser
2009-06-20 00:17:22
Instead of answering the question yourself, you might wait for someone else to post so you can give them points.
Ben Alpert
2009-06-20 00:18:29
ruby conversions here: http://www.techotopia.com/index.php/Ruby_String_Conversions
TStamper
2009-06-20 00:20:41
+11
A:
string.downcase
or if you want to modify the string in place:
string.downcase!
Ben Alpert
2009-06-20 00:16:55
I only thought about it after I had answered it, but I'll give you the cred for taking the time to answer it anyway. Thanks!
Heat Miser
2009-06-20 00:30:39
+3
A:
http://www.ruby-doc.org/core/classes/String.html
Not, trying to be sarcastic, just passing along a very useful tool
I usually just put "Ruby, Class, Datatype" into google and the appropriate rubydoc pops up
very handy
+1
A:
... and the uppercase is:
"Awesome String".upcase
=> "AWESOME STRING"
mlambie
2009-06-20 09:10:17
+4
A:
You can find out all the methods available on a String by opening irb and running:
"MyString".methods.sort
And for a list of the methods available for strings in particular:
"MyString".own_methods.sort
I use this to find out new and interesting things about objects which I might not otherwise have known existed.
mlambie
2009-06-20 09:27:57