インテル® Fortran コンパイラー XE 13.1 ユーザー・リファレンス・ガイド
Elemental Intrinsic Function (Generic): Returns the starting position of a substring within a string.
result = INDEX (string, substring [,back] [, kind])
string |
(Input) Must be of type character. |
substring |
(Input) Must be of type character. |
back |
(Input; optional) Must be of type logical. |
kind |
(Input; optional) Must be a scalar integer initialization expression. |
The result is of type integer. If kind is present, the kind parameter of the result is that specified by kind; otherwise, the kind parameter of the result is that of default integer. If the processor cannot represent the result value in the kind of the result, the result is undefined.
If back does not appear (or appears with the value false), the value returned is the minimum value of I such that string(I : I + LEN (substring) - 1) = substring(or zero if there is no such value). If LEN (string) < LEN (substring), zero is returned. If LEN (substring) = zero, 1 is returned.
If back appears with the value true, the value returned is the maximum value of I such that string(I : I + LEN (substring) - 1) = substring (or zero if there is no such value). If LEN(string) < LEN (substring), zero is returned. If LEN (substring) = zero, LEN (string) + 1 is returned.