TRIM

Salvatore Filippone filippone.salvatore@gmail.com
Fri Jul 18 09:08:00 GMT 2014


Thanks Arjen.
A bit of context: an intern was testing some code that was not doing
what it was supposed to do because it was driven by character inputs
and in one of them there were trailing tabs that TRIM did not remove.
I guess I'll have to implement my own, and of course this will  open
an uncountable infinity of cans of worms as soon as I straddle any
operating system boundary.....

Salvatore

On Fri, Jul 18, 2014 at 10:54 AM, Arjen Markus
<arjen.markus895@gmail.com> wrote:
> Hi Salvatore,
>
> AFAIK, it is supposed to remove blanks - so "space" only. It is not
> supposed to remove whitespace (space, tab, newline ...)
>
> That said, it would have been nice if you could have specified a range
> of characters to be removed, like "0" or char(9). Something along the
> lines of:
> write(*,*) trim( string, char(9)//char(10)//char(13) ). I have not
> checked the newer standards for this possibility.
>
> Regards,
>
> Arjen
>



More information about the Fortran mailing list