[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

find search word within a string

M. R.

7/31/2007 10:45:00 PM

Hi @ all

I would like to search in a string a user-defined word and I want to
find out, how many times its appear in the string. Can anyone help me?

thanks for your effort...
--
Posted via http://www.ruby-....

1 Answer

Tim Pease

7/31/2007 10:53:00 PM

0

On 7/31/07, M. R. <ribi@schwingerverband.ch> wrote:
> Hi @ all
>
> I would like to search in a string a user-defined word and I want to
> find out, how many times its appear in the string. Can anyone help me?
>

String#scan

Please read the documentation for details.

Blessings,
TwP