System.StrUtils.MatchStr
MatchStrは、文字列の配列の中に指定した文字列があるときはTrueを返します。
この関数は、大文字と小文字を区別します。
uses
System.StrUtils;
const
Strings: array[0..2] of string = ('foo', 'bar', 'bazz');
if MatchStr('bar', Strings) then //=> True
…
if MatchStr('BAR', Strings) then //=> False
…
System.StrUtils.MatchText
MatchTextは、文字列の配列の中に指定した文字列があるときはTrueを返します。
この関数は、大文字と小文字を区別しません。
uses
System.StrUtils;
const
Strings: array[0..2] of string = ('foo', 'bar', 'bazz');
if MatchText('bar', Strings) then //=> True
…
if MatchText('BAR', Strings) then //=> True
…
if MatchText('Hoge', Strings) then //=> False
…
System.StrUtils.IndexStr
IndexStrは、文字列の配列の中に指定した文字があるときはインデックスを返します。一致する文字列がないときは-1を返します。
この関数は、大文字と小文字を区別します。
uses
System.StrUtils;
const
Strings: array[0..2] of string = ('foo', 'bar', 'bazz');
WriteLn(IndexStr('bar', Strings)); //=> 1
WriteLn(IndexStr('BAR', Strings)); //=> -1
WriteLn(IndexStr('Hoge', Strings)); //=> -1
System.StrUtils.IndexText
この関数は、大文字と小文字を区別しません。
uses
System.StrUtils;
const
Strings: array[0..2] of string = ('foo', 'bar', 'bazz');
WriteLn(IndexText('bar', Strings)); //=> 1
WriteLn(IndexText('BAR', Strings)); //=> 1
WriteLn(IndexText('Hoge', Strings)); //=> -1