lowercase Subroutine

public subroutine lowercase(str)

Convert the string to lowercase.

Arguments

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

Source Code

    subroutine lowercase(str)

    implicit none

    character(len=*),intent(inout) :: str

    integer :: i,idx

    do i=1,len_trim(str)
        idx = index(str(i:i),upper)
        if (idx>0) str(i:i) = lower(idx:idx)
    end do

    end subroutine lowercase