string for any of the characters in a
set of characters.
back is either absent or equals
false, this function returns the position of the leftmost character of
string that is in
true, the rightmost position is returned. If no character of
set is found in
string, the result is zero.
result = scan(string, set[, back [, kind]])
string- Shall be of type
set- Shall be of type
back- (Optional) shall be of type
kind- (Optional) An
integerinitialization expression indicating the kind parameter of the result.
The return value is of type
integer and of kind
kind is absent, the return value is of default integer kind.
program test_scan write(*,*) scan("fortran", "ao") ! 2, found 'o' write(*,*) scan("fortran", "ao", .true.) ! 6, found 'a' write(*,*) scan("fortran", "c++") ! 0, found none end program