Scilab 5.3.0
- Scilab Online 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
strcmp
compare character strings
Calling Sequence
res = strcmp(string_one,string_two,[,'i'])
Arguments
- string_one
A character string or matrix of character strings
- string_two
A character string or matrix of character strings
- 'i'
parameter to do stricmp (case independent), default value is 's'
- res
matrix.
Description
res = strcmp(string_one,string_two)
returns an
integral value indicating the relationship between the strings.
A value greater than zero indicates that the first character that
does not match has a greater value in string_one
than
in string_two
And a value less than zero indicates the opposite.
Examples
TXT1 = ['scilab','SciLab';'Strcmp','STRcmp']; TXT2 = ['ScIlAb','sciLab';'sTrCmP','StrCMP']; strcmp(TXT1,TXT2) strcmp(TXT1,'scilab') strcmp(TXT1,'SciLab') strcmp(TXT1,TXT2,'i')
<< strchr | Strings | strcmpi >> |