reverse(3f) - [M_strings:EDITING] Return a string reversed (LICENSE:PD)
Synopsis
Description
Examples
Author
License
elemental pure function reverse(str) result (string)
character(*), intent(in) :: str character(len(str)) :: string
reverse(string) returns a copy of the input string with all characters reversed from right to left.
Sample program:
program demo_reverse use M_strings, only: reverse implicit none character(len=:),allocatable :: s write(*,*)REVERSE STRINGS:,reverse(Madam, Im Adam) s=abcdefghijklmnopqrstuvwxyz write(*,*) original input string is ....,s write(*,*) reversed output string is ...,reverse(s) end program demo_reverseResults:
> REVERSE STRINGS:madA mI ,madaM > original input string is ....abcdefghijklmnopqrstuvwxyz > reversed output string is ...zyxwvutsrqponmlkjihgfedcba
John S. Urban
Public Domain
Nemo Release 3.1 | reverse (3m_strings) | January 10, 2025 |