From: Brian Candler Date: 2011-01-24T03:07:33+09:00 Subject: Re: How to convert letters to uppercase? Richard Sandoval wrote in post #976947: > Im unfamiliar with regular expressions. > > How would I be able to change all letters to uppercase to the first > period? > > Before: > > helpuser01.hello.txt > > > After: > > HELPUSER01.hello.txt 1. Write a regular expression to match everything before the first period. 2. Substitute it with the uppercased version str = "helpuser01.hello.txt" str.sub!(/\A.*?\./) { $&.upcase } puts str -- Posted via http://www.ruby-forum.com/.