Convert string of default kind to ASCII string.
use penf
character(len=:, kind=ASCII), allocatable :: string
string = str_ascii('I was DEFAULT kind, but now I am ASCII')
print "(A)", string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | input | Input string of default kind. |
Output string of ASCII kind.
pure function str_ascii_default(input) result(output)
!< Convert string of default kind to ASCII string.
!<
!<```fortran
!< use penf
!< character(len=:, kind=ASCII), allocatable :: string
!< string = str_ascii('I was DEFAULT kind, but now I am ASCII')
!< print "(A)", string
!<```
!=> I was DEFAULT kind, but now I am ASCII <<<
character(len=*), intent(in) :: input !< Input string of default kind.
character(len=:, kind=ASCII), allocatable :: output !< Output string of ASCII kind.
output = input
endfunction str_ascii_default