startsWith
checks if string starts with pattern.
📝Syntax
tf = startsWith(str, pattern)
tf = startsWith(str, pattern,'IgnoreCase', true)
tf = startsWith(str, pattern,'IgnoreCase', false)
📥Input Arguments
Parameter Description
str a string, string array or cell of strings.
pattern a string to find.
📤Output Arguments
Parameter Description
tf a matrix of logical.
📄Description

startsWith returns true if str starts with pattern.

💡Examples
str = 'To make a mountain out of a molehill';
k = startsWith (str, 'in')
k = startsWith (str, 'to')
k = startsWith (str, 'to', 'IgnoreCase', true)

A = {'Nel', 'son'; 'Nelson', 'Modules'}
k = startsWith(A, 'Nel')

A = ["Nel", "son"; "Nelson", "Modules"];
k = startsWith(A, "Nel")
🔗See Also
endsWithcontains
🕔Version History
Version Description
1.0.0 initial version
Edit this page on GitHub