@brief return string in upper case @author Igor S. Gerasimov @date Sep, 2019 --Initial release-- @date May, 2021 Moved to strings @date Sep, 2021 subroutine -> function @param line - (in)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | input_string |
pure function to_upper(input_string) result(output_string) character(*), intent(in) :: input_string character(:), allocatable :: output_string integer :: i, ic output_string = input_string do i = 1, len(output_string) ic = iachar(output_string(i:i)) if (ic <= Z_LOWER .and. ic >= A_LOWER) then output_string(i:i) = achar(ic-UPPER_TO_LOWER) end if end do end function to_upper