Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.4.0 - Русский

Change language to:
English - Français - 日本語 - Português -

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

Scilab help >> Strings > strspn


Get span of character set in string

Calling Sequence

res = strspn(str1,str2)



A character string or matrix of character strings


A character string or matrix of character strings




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");
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
Report an issue
<< strsplit Strings strstr >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Oct 01 17:41:10 CEST 2012