Why is there a difference in returned length between:
character(28) :: str='I-have-blanks-behind-me ' string=trim(string) l=len(string) ! => l=28
l=len(trim(string)) ! => l=23
and of course
l=len_trim(string) ! => l=23
same situation for
string=trim(string) l=index(string," ") ! => l=24
l=index(trim(string)," ") ! => l=0
This seems to be a bit inconsistent.
I am just curious why it is implemented this way.
It appears that during the assignment:
the string is padded with blanks. Is this Fortran standard?