Return the leftmost (if back is either absent or equals false, otherwise the rightmost) character of string that is not
in set. If all characters of string are found in set, the result is zero.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(string), | intent(in) | :: | self | The string. |
||
| character(kind=CK,len=*), | intent(in) | :: | set | Searched set. |
||
| logical, | intent(in), | optional | :: | back | Start of the last occurrence rather than the first. |
Result of the search.
elemental function sverify(self, set, back) result(i)
!---------------------------------------------------------------------------------------------------------------------------------
!< Return the leftmost (if `back` is either absent or equals false, otherwise the rightmost) character of string that is not
!< in `set`. If all characters of `string` are found in `set`, the result is zero.
!---------------------------------------------------------------------------------------------------------------------------------
class(string), intent(in) :: self !< The string.
character(kind=CK, len=*), intent(in) :: set !< Searched set.
logical, intent(in), optional :: back !< Start of the last occurrence rather than the first.
integer :: i !< Result of the search.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
if (allocated(self%raw)) then
i = verify(string=self%raw, set=set, back=back)
else
i = 0
endif
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction sverify