contains
- :
retval =contains(str, pattern)¶ - :
retval =contains(str, pattern, "IgnoreCase", ignore_case)¶ Check whether string(s) contain pattern(s).
containsreturns a logical array the same size as str indicating which strings contain at least one of the patterns in pattern. The comparison respects letter case unless the option"IgnoreCase"is set to true.contains ("hello world", "world") ⇒ 1 contains ({"hello", "world"}, "lo") ⇒ [1, 0] contains ({"Abc", "XyZ"}, {"ab", "yz"}, "IgnoreCase", true) ⇒ [1, 1]