Scilab Home page | Wiki | Bug tracker | Forge | Mailing list archives | ATOMS | File exchange
Please login or create an account
Change language to: English - Français - Português - 日本語 -

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

Scilab help >> Strings > strcmpi

strcmpi

compare character strings (case independent)

Calling Sequence

res = strcmpi(string_one,string_two)

Arguments

string_one

A character string or matrix of character strings

string_two

A character string or matrix of character strings

res

matrix.

Description

res = strcmpi(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'];
strcmpi(TXT1,TXT2)
strcmpi(TXT1,'scilab')

See Also

  • strcat — concatenate character strings
  • strcmp — compare character strings

Comments

Author : Stanislav Kroter posted the 11/05/2013 17:56
Эта функция может выдавать и минус единицу: всё зависит от того какое место в алфавите/нумерации занимает string_one относительно string_two:

-->strcmpi('первый','второй')
ans =

1.

-->strcmpi('первый','третий')
ans =

- 1.

-->strcmpi('2','3')
ans =

- 1.

-->strcmpi('3','2')
ans =

1.
Reply to this comment
Please login to comment this page


Add a comment:
Please login to comment this page.

Report an issue
<< strcmp Strings strcspn >>

Scilab Enterprises
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