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

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -