Reverse the character order in the input character variable (Specification)
Version: experimental
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | string |
pure function reverse(string) result(reverse_string) character(len=*), intent(in) :: string character(len=len(string)) :: reverse_string integer :: i, n n = len(string) do i = 1, n reverse_string(n-i+1:n-i+1) = string(i:i) end do end function reverse