tf = endsWith(str, pattern)
tf = endsWith(str, pattern,'IgnoreCase', true)
tf = endsWith(str, pattern,'IgnoreCase', false)
| Parameter | Description |
|---|---|
| str | a string, string array, cell of strings or categorical array. |
| pattern | a string to find. |
| Parameter | Description |
|---|---|
| tf | a matrix of logical. |
endsWith returns true if str ends withpattern.
If str is a categorical array, endsWith tests the category name of each element and returns a logical array of the same size. Undefined elements return false. pattern cannot be categorical.
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")
C = categorical({'winter storm', 'fire', 'Thunder Storm', ''});
tf = endsWith(C, "storm", 'IgnoreCase', true)
| Version | Description |
|---|---|
| 1.0.0 | initial version |
| 2.0.0 | categorical array accepted as str input. |