uppercase Subroutine

public subroutine uppercase(str)

Convert the string to uppercase.

Arguments

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

Source Code

    subroutine uppercase(str)

    implicit none

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

    integer :: i,idx

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

    end subroutine uppercase