strspnget span of character set in stringCalling Sequenceres = strspn(str1, str2)Argumentsstr1
a character string or matrix of character strings.
str2
a character string or matrix of character strings.
resa matrix of character strings.Descriptionres = strspn(str1, str2) returns the length of the initial portion of str1 which consists only of characters that are part of str2.
str1 must have same dimensions as str2 or str2 must be 1x1 string. The output will be the same dimensions as str1 in both cases.
ExamplesSee Also
strcspn