From: Dave Aronson Date: 2011-10-31T23:14:06+09:00 Subject: Re: "A" and "an" articles in front of words On Sun, Oct 30, 2011 at 22:23, jake kaiden wrote: >  ruby Strings have an easy way of finding the first letter, the `[]` > method...  you can do something like this: > >  string = "hi there" >  puts string[0] > >  => h In 1.9 yes... but many people are still on 1.8, which will give a number instead. Gotta use string[0:0] instead. :-( >  you could use a regular expression > (http://www.ruby-doc.org/core-1.9.2/Regexp.html) to determine whether to > put an "a" or an "an" before each word based on its first letter... If she's having a hard time extracting a character from a string, I don't think it's sporting to hit her with regexps quite yet. ;-) -Dave -- LOOKING FOR WORK! What: Ruby (on/off Rails), Python, other modern languages. Where: Northern Virginia, Washington DC (near Orange Line), and remote work. See: davearonson.com (main) * codosaur.us (code) * dare2xl.com (excellence). Specialization is for insects. (Heinlein) - Have Pun, Will Babble! (Aronson)