to_lower Function

public pure function to_lower(in_str) result(string)

Changes a string to lower case

Arguments

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

Return Value character(len=len_trim(in_str))


Contents

Source Code


Source Code

    pure function to_lower (in_str) result(string)
        character(*), intent(in) :: in_str
        character(len_trim(in_str)) :: string
        integer :: ic, i

        do i = 1, len(string)
            ic = index(UPPERCASE_chars, in_str(i:i))
            if (ic > 0) then
                string(i:i) = lowercase_chars(ic:ic)
            else
                string(i:i) = in_str(i:i)
            end if
        end do
    end function to_lower