[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Exact phrase in include?

Pål Bergström

7/16/2008 9:15:00 PM

I have a string that I check with include? There are two words in the
string that contains the same word of "design". One is "design" the
other "designer". How can I check for an exact phrase of "design"?
--
Posted via http://www.ruby-....

2 Answers

Sebastian Hungerecker

7/16/2008 9:25:00 PM

0

P=C3=A5l Bergstr=C3=B6m wrote:
> I have a string that I check with include? There are two words in the
> string that contains the same word of "design". One is "design" the
> other "designer". How can I check for an exact phrase of "design"?

string =3D~ /\bdesign\b/

Pål Bergström

7/16/2008 9:39:00 PM

0

Sebastian Hungerecker wrote:
> Pål Bergström wrote:
>
> string =~ /\bdesign\b/

Perfect. Thanks.
--
Posted via http://www.ruby-....