Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(string), | intent(in) | :: | self | The string. |
Result of the test.
Return true if all characters in the string are uppercase.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | public | :: | c | Character counter. |
elemental function is_upper(self)
!---------------------------------------------------------------------------------------------------------------------------------
!< Return true if all characters in the string are uppercase.
!---------------------------------------------------------------------------------------------------------------------------------
class(string), intent(in) :: self !< The string.
logical :: is_upper !< Result of the test.
integer :: c !< Character counter.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
is_upper = .false.
if (allocated(self%raw)) then
is_upper = .true.
do c=1, len(self%raw)
if (index(LOWER_ALPHABET, self%raw(c:c))>0) then
is_upper = .false.
exit
endif
enddo
endif
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction is_upper