Manual Reference Pages  - couple (3m_strings)

NAME

couple(3f) - [M_strings:ARRAY] converts between CHARACTER scalar and array of single characters (LICENSE:PD)

CONTENTS

Synopsis
Description
Examples
See Also
Author
License

SYNOPSIS

pure function couple(array) result (string)

    character(len=1),intent(in) :: array(:)
    character(len=SIZE(array))  :: string

DESCRIPTION

COUPLE(3f): function that switches an array of single characters to a CHARACTER string.

EXAMPLES

Sample program:

   program demo_couple
   use M_strings, only : couple
   character(len=:),allocatable :: array(:)
    array=[’T’,’h’,’i’,’s’,’ ’,’i’,’s’,’ ’,’a’,’ ’,’s’,’t’,’r’,’i’,’n’,’g’]

! show the array write(*,’(1x,*("[",a,"]":))’) array ! show the string write(*,’(1x,*("[",a,"]":))’) couple(array)

end program demo_couple

Results:

 >  [T][h][i][s][ ][i][s][ ][a][ ][s][t][r][i][n][g]
 >  [This is a string]

SEE ALSO

switch(3), join(3), uncouple(3), c2s(3), s2c(3)

AUTHOR

John S. Urban

LICENSE

Public Domain