reverse(3f) - [M_unicode:CASE] reverse order of glyphs on a line (LICENSE:MIT)
Synopsis
Description
Options
Returns
Examples
Author
License
impure elemental function reverse(str) result (string)
type(unicode_type),intent(in) :: str type(unicode_type) :: string
reverse(string) returns a copy of the input string with all characters in reverse position on the line.
str string to reverse
reverse copy of the input string with order of characters on the line reversed.
Sample program:
program demo_reverse use iso_fortran_env, only : stdout => output_unit use M_unicode, only : reverse, ch=>character use M_unicode, only : unicode_type, assignment(=) use M_unicode, only : ut => unicode_type, operator(==) implicit none character(len=*),parameter :: g=(g0) type(unicode_type) :: original(3) original(1)=abcde original(2)=한국말 original(3)=五十七 write(stdout,g)ch(original) write(stdout,*) write(stdout,g)ch(reverse(original)) end program demo_reverseExpected output
> abcde > 한국말 > 五十七> edcba > 말국한 > 七十五
John S. Urban
