perl - Check whether a string contains a substring -


How can I determine if a string contains a particular place or not?

More specifically, I have to see if s1.domain.com exists in the string variable present.

  if (index ($ str, $ substr)! = -1) {Print "$ str $ includes substr \ n"; }   

This will return the status of the first occurrence of $ str in $ substr , or -1 if the substrings are not found.

Comments

Popular posts from this blog

php - Creating canonical URLs with custom route-classes -

mysql - Formatting problem with PHP DateTime Difference when used as part of an equation -

Mysql Local server hardware -