endsWith
checks if string ends with pattern.
📝Syntax
tf = endsWith(str, pattern)
tf = endsWith(str, pattern,'IgnoreCase', true)
tf = endsWith(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

endsWith returns true if str ends with pattern.

💡Examples
str = 'To make a mountain out of a molehill';
k = endsWith (str, 'hill')
k = endsWith (str, 'molehill')
k = endsWith (str, 'Hill', 'IgnoreCase', true)

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

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