islower(3f) - [M_strings:COMPARE] returns .true. if character is a
miniscule letter (a-z)
(LICENSE:PD)
elemental function islower(onechar)
character,intent(in) :: onechar
logical :: islower
islower(3f) returns .true. if character is a miniscule letter (a-z)
onechar character to test
islower logical value returns true if character is a lowercase
ASCII character else false.
Sample program
program demo_islower
use M_strings, only : islower
implicit none
integer :: i
character(len=1),parameter :: string(*)=[(char(i),i=0,127)]
write(*,'(15(g0,1x))')'ISLOWER: ', &
& iachar(pack( string, islower(string) ))
write(*,'(15(g0,1x))')'ISLOWER: ', &
& pack( string, islower(string) )
end program demo_islower
Results:
ISLOWER: 97 98 99 100 101 102 103 104 105 106 107 108 109 110
111 112 113 114 115 116 117 118 119 120 121 122
ISLOWER: 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 |
elemental function islower(ch) result(res)
! ident_77="@(#) M_strings islower(3f) returns true if character is a miniscule 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 islower