Next: , Previous: , Up: API Alphabetically   [Contents]


8.2.56 startsWith

Function: out = startsWith (str, pattern)
Function: out = startsWith (…, 'IgnoreCase', IgnoreCase)

Test if strings start with a pattern.

Tests whether the given strings start with the given pattern(s).

str (char, cellstr, or string) is a list of strings to compare against pattern.

pattern (char, cellstr, or string) is a list of patterns to match. These are literal plain string patterns, not regex patterns. If more than one pattern is supplied, the return value is true if the string matched any of them.

Returns a logical array of the same size as the string array represented by str.