verify(3f) - [FORTRAN:INTRINSIC:CHARACTER] Scan a string for the absence of a set of characters
Syntax
Description
Arguments
Return Value
Example
Standard
Class
See Also
result = verify(string, set[, back [, kind]])
Verifies that all the characters in STRING belong to the set of characters in SET.
If BACK is either absent or equals FALSE, this function returns the position of the leftmost character of STRING that is not in SET. If BACK equals TRUE, the rightmost position is returned. If all characters of STRING are found in SET, the result is zero.
STRING - Shall be of type CHARACTER. SET - Shall be of type CHARACTER. BACK - (Optional) shall be of type LOGICAL. KIND - (Optional) An INTEGER initialization expression indicating the kind parameter of the result.
The return value is of type INTEGER and of kind KIND. If KIND is absent, the return value is of default integer kind.
Sample program:
program demo_verify write(*,*) verify("fortran", "ao") ! 1, found f write(*,*) verify("fortran", "foo") ! 3, found r write(*,*) verify("fortran", "c++") ! 1, found f write(*,*) verify("fortran", "c++", .true.) ! 7, found n write(*,*) verify("fortran", "fortran") ! 0 found none end program demo_verify
[[Fortran 95]] and later, with KIND argument [[Fortran 2003]] and later
Elemental function
Functions that perform operations on character strings, return lengths of arguments, and search for certain arguments:
Elemental: ADJUSTL, ADJUSTR, INDEX, LEN_TRIM, SCAN, VERIFY; Nonelemental: REPEAT, TRIM
verify (3) | March 19, 2019 |