Manual Reference Pages  - uncouple (3m_strings)

NAME

uncouple(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 uncouple(string) result (array)

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

DESCRIPTION

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

EXAMPLES

Sample program:

   program demo_uncouple
   use M_strings, only : uncouple
   character(len=*),parameter   :: string=’This is a string’

write(*,’(1x,*("[",a,"]":))’) string ! converted to character array write(*,’(1x,*("[",a,"]":))’) uncouple(string)

end program demo_uncouple

Results:

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

SEE ALSO

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

AUTHOR

John S. Urban

LICENSE

Public Domain