Manual Reference Pages  - reverse (3m_strings)

NAME

reverse(3f) - [M_strings:EDITING] Return a string reversed (LICENSE:PD)

CONTENTS

Synopsis
Description
Examples
Author
License

SYNOPSIS

elemental pure function reverse(str) result (string)

    character(*), intent(in) :: str
    character(len(str))      :: string

DESCRIPTION

reverse(string) returns a copy of the input string with all characters reversed from right to left.

EXAMPLES

Sample program:

      program demo_reverse
      use M_strings, only: reverse
      implicit none
      character(len=:),allocatable  :: s
         write(*,*)’REVERSE STRINGS:’,reverse(’Madam, I’’m Adam’)
         s=’abcdefghijklmnopqrstuvwxyz’
         write(*,*) ’original input string is ....’,s
         write(*,*) ’reversed output string is ...’,reverse(s)
      end program demo_reverse

Results:

     >  REVERSE STRINGS:madA m’I ,madaM
     >  original input string is ....abcdefghijklmnopqrstuvwxyz
     >  reversed output string is ...zyxwvutsrqponmlkjihgfedcba

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 reverse (3m_strings) July 20, 2024
Generated by manServer 1.08 from 28d5473b-cf59-4ba1-be52-19a8288e086f using man macros.