lower Function

public pure elemental function lower(str) result(string)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: str

Return Value character(len=len(str))


Contents

Source Code


Source Code

elemental pure function lower(str) result (string)

! ident_74="@(#) M_strings lower(3f) Changes a string to lowercase"

character(*), intent(In)     :: str
character(len(str))          :: string
integer                      :: i
   string = str
   do i = 1, len(str)                                ! step thru each letter in the string in specified range
      select case (str(i:i))
      case ('A':'Z')
         string(i:i) = char(iachar(str(i:i))+32)     ! change letter to miniscule
      case default
      end select
   end do
end function lower