Return a string with all uppercase characters.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
Input string. |
Upper case string.
elemental function upper(string) !< Return a string with all uppercase characters. character(len=*), intent(in) :: string !< Input string. character(len=len(string)) :: upper !< Upper case string. integer :: n1 !< Characters counter. integer :: n2 !< Characters counter. upper = string do n1=1, len(string) n2 = index(LOWER_ALPHABET, string(n1:n1)) if (n2>0) upper(n1:n1) = UPPER_ALPHABET(n2:n2) enddo endfunction upper