Mmake the whole string to upper case
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | text | Input string of any case |
Output string of upper case
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