isupper(3f) - [M_strings:COMPARE] returns .true. if character is an
uppercase letter (A-Z)
(LICENSE:PD)
elemental function isupper(onechar)
character,intent(in) :: onechar
logical :: isupper
isupper(3f) returns .true. if character is an uppercase letter (A-Z)
onechar character to test
isupper logical value returns true if character is an uppercase
ASCII character else false.
Sample program:
program demo_isupper
use M_strings, only : isupper
implicit none
integer :: i
character(len=1),parameter :: string(*)=[(char(i),i=0,127)]
write(*,'(10(g0,1x))')'ISUPPER: ', &
& iachar(pack( string, isupper(string) ))
write(*,'(10(g0,1x))')'ISUPPER: ', &
& pack( string, isupper(string) )
end program demo_isupper
Results:
ISUPPER: 65 66 67 68 69 70 71 72 73
74 75 76 77 78 79 80 81 82 83
84 85 86 87 88 89 90
ISUPPER: A B C D E F G H I
J K L M N O P Q R S
T U V W X Y Z
John S. Urban
Public Domain
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character, | intent(in) | :: | ch |
pure elemental function isupper(ch) result(res)
! ident_76="@(#) M_strings isupper(3f) returns true if character is an uppercase letter (A-Z)"
character,intent(in) :: ch
logical :: res
select case(ch)
case('A':'Z'); res=.true.
case default; res=.false.
end select
end function isupper