[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: [newbie] upper to lower first letter of a word

dblack

9/23/2003 6:26:00 PM

1 Answer

yvon.thoravallist

9/23/2003 6:41:00 PM

0

<dblack@superlink.net> wrote:

> I believe the /s modifier to the regex will help you here by changing
> the encoding, though I''m having character-rendering issues which make
> it hard for me to test.... But try this, in the hope that I''m right
> even though I can''t see the characters:
>
> str.gsub!(/\b[a-z]+/s) {|w| black_list.include?(w) ? w : w.capitalize}

tanxs, i don''t remember (from Perl) what''s the meaning of this "s" ?


--
Yvon