matlab.unittest.constraints.ContainsSubstring class
Package: matlab.unittest.constraints
Superclasses: matlab.unittest.constraints.BooleanConstraint
Constraint specifying string containing substring
Construction
ContainsSubstring(
creates
a constraint that specifies a string scalar or character vector containing substring
)substring
.
The constraint is satisfied only if the actual value contains an expected
substring.
ContainsSubstring(
provides
a constraint with additional options specified by one or more substring
,Name,Value
)Name,Value
pair
arguments. Name
must
appear inside single quotes (''
). You can specify
several name-value pair arguments in any order as Name1,Value1,...,NameN,ValueN
.
Input Arguments
|
Text that must be contained within the actual value, specified
as a character vector or string scalar. |
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Name-value arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
|
Indicator to ignore case, specified as Default: |
|
Indicator to ignore whitespace, specified as
Note When Default: |
|
Number of times |
Properties
|
Indicator if the constraint is insensitive to case, specified in the name-value pair argument,
|
|
Indicator if the constraint is insensitive to whitespace, specified in the name-value pair
argument, |
|
Character vector or string scalar that must be included in the actual value, specified in the
input argument, |
Copy Semantics
Value. To learn how value classes affect copy operations, see Copying Objects.
Examples
See Also
IsSubstringOf
| EndsWithSubstring
| StartsWithSubstring
| Matches