Todd Benson wrote:
> On Tue, Apr 8, 2008 at 1:53 PM, Peter Bailey <pbailey / bna.com> wrote:
>>  file.gsub(/^<row><entry><text><emph face="b">(.*)<\/emph>/)  do |match|
>>  #(.*)<\/emph>theQuickBrownFoxJumpedOverTheLazyDog.
>>
>>  I want this:
>>
>>  <row><entry><text><emph face="b">The Quick Brown Fox Jumped Over The
>>  Lazy Dog.<\/emph>/
>>
>>
>>  Thanks,
>>  Peter
> 
> I don't know what the original text looks like in test1.txt, but this
> might point you in the right direction...
> 
> irb(main):001:0> s = "the quick brown fox"
> => "the quick brown fox"
> irb(main):002:0> s.split.map {|w| w.capitalize}.join ' '
> => "The Quick Brown Fox"
> 
> Todd

Thanks, Todd.
The original text is just:
<row><entry><text><emph face="b">THE QUICK BROWN FOX JUMPED OVER THE 
LAZY DOG.<\/emph>/

Should I just make your "s" equal to $1 from my original gsub?

-Peter
-- 
Posted via http://www.ruby-forum.com/.