Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
6.1.0 - 日本語

Change language to:
English - Français - Português - Русский

Please note that the recommended version of Scilab is 2024.0.0. 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')

参照

Report an issue
<< strchr Strings strcspn >>

Copyright (c) 2022-2023 (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:
Tue Feb 25 08:53:23 CET 2020