Get span of character set in string
res = strspn(str1,str2)
A character string or matrix of character strings
A character string or matrix of character strings
matrix.
res = 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 than str2 or str1 must be a string.
i = strspn("129th","1234567890"); printf ("The length of initial number is %d.\n",i); i = strspn(["129th","130th"],["1234567890","130t"]) | ![]() | ![]() |