Topic: PHP's strstr and preg_replace in Ruby

Hi

I'd like to know what are the PHP's strstr and preg_replace of Ruby. Would someone know how?

Thanks

Re: PHP's strstr and preg_replace in Ruby

See gsub for something similar to preg_replace. As for strstr I'm not sure. If you just want to see if a string exists in another string, use include?. Otherwise the proper method varies depending on what you want to do (AFAIK).

Railscasts - Free Ruby on Rails Screencasts