Here is another maybe-trivial--problem.
I cannot figure out how to write a character function that returns a variable-length string just like the intrinsic [tt]trim[/tt] does.
In the example below, the [tt]len[/tt] applied to [tt]trim[/tt] returns
the length of the trimmed string.
How can I write my own [tt]mytrim[/tt]?
How does fortran manage the length of strings?
I cannot figure out how to write a character function that returns a variable-length string just like the intrinsic [tt]trim[/tt] does.
In the example below, the [tt]len[/tt] applied to [tt]trim[/tt] returns
the length of the trimmed string.
Code:
character(len=100) :: qaz='qwerty'
print*,len(qaz)
print*,len(trim(qaz))
How can I write my own [tt]mytrim[/tt]?
How does fortran manage the length of strings?