Scilab 5.3.1
- Scilab help
- Strings
- ascii
- blanks
- code2str
- convstr
- emptystr
- eval
- evstr
- grep
- isalphanum
- isascii
- isdigit
- isletter
- isnum
- justify
- length
- part
- regexp
- sci2exp
- str2code
- strcat
- strchr
- strcmp
- strcmpi
- strcspn
- strindex
- string
- strings
- stripblanks
- strncpy
- strrchr
- strrev
- strsplit
- strspn
- strstr
- strsubst
- strtod
- strtok
- tokenpos
- tokens
- tree2code
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
strspn
Get span of character set in string
Calling Sequence
res = strspn(str1,str2)
Arguments
- str1
A character string or matrix of character strings
- str2
A character string or matrix of character strings
- res
matrix.
Description
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.
Examples
i = strspn("129th","1234567890"); printf ("The length of initial number is %d.\n",i); i = strspn(["129th","130th"],["1234567890","130t"])
See Also
- strcspn — Get span until character in string
<< strsplit | Strings | strstr >> |