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.2. This page might be outdated.
See the recommended documentation of this function

Scilabヘルプ >> Strings > strcmp

strcmp

文字列を比較

呼び出し手順

res = strcmp(string_one, string_two, [,'i'])

引数

string_one

文字列または文字列の行列

string_two

文字列または文字列の行列

'i'

optional parameter to compare strings in a case-independent way. デフォルト値は 's'.

res

整数の行列.

説明

res = strcmp(string_one, string_two) (またはres = strcmp(string_one, string_two, 's'))は, 文字列の間の関係(辞書順)を示す整数値を返します.

ゼロより大きい値は,一致しない最初の文字について, string_oneの方が string_twoよりも大きな値を有している ことを示します.

res = strcmp(string_one, string_two, 'i')は, string_onestring_two (大文字小文字を区別しません) に等しい場合に0を返し, 1はその逆を示します.

TXT1 = ['scilab','SciLab';'Strcmp','STRcmp'];
TXT2 = ['ScIlAb','sciLab';'sTrCmP','StrCMP'];
strcmp(TXT1,TXT2)
strcmp(TXT1,'scilab')
strcmp(TXT1,'SciLab')
strcmp(TXT1,TXT2,'i')

参照

Scilab Enterprises
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Mon Feb 12 23:12:41 CET 2018