Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Português - 日本語 - Русский

Please note that the recommended version of Scilab is 6.0.0. This page might be outdated.
See the recommended documentation of this function

Aide de Scilab >> Chaînes de caractères > strspn

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

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
Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 02 13:54:34 CEST 2014