ToUpperCase Function

private pure function ToUpperCase(str) result(res)

Arguments

TypeIntentOptionalAttributesName
character, intent(in) :: str

Return Value character


Contents

Source Code


Source Code

  pure function ToUpperCase(str) result(res)
    character(*),intent(in) :: str
    character(len(str)) :: res
    integer :: i

    do i = 1,len(str)
      select case(str(i:i))
      case('a':'z')
        res(i:i) = achar(iachar(str(i:i))-32)
      case default
        res(i:i) = str(i:i)
      endselect
    enddo
  endfunction ToUpperCase