Converts uppercase to lowercase, adapted from here
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | s1 |
string to transform to lower case |
result: same string but each character is lower case
function lower(s1) result (s2) !! Converts uppercase to lowercase, adapted from [here](http://fortranwiki.org/fortran/show/String_Functions) character(*), intent(in) :: s1 !! *string to transform to lower case* character(len(s1)) :: s2 !! *result: same string but each character is lower case* character(len=1) :: ch integer(kind=I4), parameter :: duc = ichar('A') - ichar('a') integer(kind=I4) :: i do i = 1, len(s1) ch = s1(i:i) if (ch >= 'A'.and.ch <= 'Z') ch = char(ichar(ch)-duc) s2(i:i) = ch enddo return endfunction lower