Scilab 6.0.0
- Scilab Help
- Strings
- ascii
- asciimat
- blanks
- char
- convstr
- emptystr
- eval
- evstr
- grep
- isalphanum
- isascii
- isdigit
- isletter
- isnum
- justify
- length
- part
- regexp
- sci2exp
- strcat
- strchr
- strcmp
- strcmpi
- strcspn
- strindex
- string
- strings
- stripblanks
- strncpy
- strrchr
- strrev
- strsplit
- strspn
- strstr
- strsubst
- strtod
- strtok
- tokenpos
- tokens
Scilab Help >> Strings > strspn
strspn
get span of character set in string
Syntax
res = strspn(str1, str2)
Arguments
- str1
a character string or matrix of character strings.
- str2
a character string or matrix of character strings.
- res
a matrix of character strings.
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 as str2 or str2 must be 1x1 string. The output will be the same dimensions as str1 in both cases.
Examples
i = strspn("129th","1234567890"); mprintf ("The length of initial number is %d.\n",i); i = strspn(["129th","130th"],["1234567890","130t"])
See Also
- strcspn — get span until character in string
Comments
Add a comment:
Please login to comment this page.