ucase Function

public function ucase(text) result(res)

Mmake the whole string to upper case

Arguments

Type IntentOptional AttributesName
character(len=*), intent(in) :: text

Input string of any case

Return Value character(len=STRING_BUFFER_LENGTH)

Output string of upper case


Contents

Source Code


Source Code

    function ucase(text) result(res)
      !<Mmake the whole string to upper case
      CHARACTER(len=*), intent(in)        :: text
      !< Input string of any case
      character(len=STRING_BUFFER_LENGTH) :: res
      !< Output string of upper case
      integer ::  I,C
  
      res=text
      DO I = 1,LEN(TEXT)
        C = INDEX("abcdefghijklmnopqrstuvwxyz",TEXT(I:I))
        IF (C.GT.0) res(I:I) = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"(C:C)
      END DO
  
    end function ucase