StringInString()関数StringInString()
- Last UpdatedOct 08, 2024
- 1 minute read
テキスト文字列内の指定した文字列の最初のインスタンスの位置を返します。
カテゴリ
文字列
構文
IntegerResult=StringInString(Text、SearchFor、StartPos、CaseSens);
パラメータ
テキスト
検索範囲のテキスト文字列。実際の文字列または文字列属性。
検索対象
検索対象の文字列。実際の文字列または文字列属性。
[開始値]
検索を開始するテキスト内の位置を指定します。数値または整数属性。
casesen
検索で大文字と小文字を区別するかどうかを指定します。
0 = 大文字と小文字は区別されません。
1 = 大文字と小文字が区別されます。
数値または整数属性。
備考
複数の SearchFor が見つかった場合、最初のインスタンスの位置が返されます。
例
StringInString("The mixer is running", "mix", 1, 0) ' 戻り値 5;
StringInString("Today is Thursday", "day", 1, 0) ' 戻り値 3;
StringInString("TodayisThursday","day",1,0)'戻り値3;
StringInString("Today is Veteran's Day", "Day", 1, 1) ' 戻り値 20;
StringInString("Today is Veteran's Day", "Night", 1, 1) ' 戻り値 0;