Main Content
contains
Determine if pattern is in strings
Description
TF = contains(
returns str
,pat
)1
(true
) if str
contains the specified pattern, and returns 0
(false
) otherwise.
If pat
is an array containing multiple patterns, then
contains
returns 1
if it finds any element
of pat
in str
.
If str
is a string array or cell array, then
TF
is a logical array that is the same size as
str
.
Examples
Input Arguments
Extended Capabilities
Version History
Introduced in R2016b