This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: TRIM
- From: Salvatore Filippone <filippone dot salvatore at gmail dot com>
- To: Arjen Markus <arjen dot markus895 at gmail dot com>
- Cc: Fortran List <fortran at gcc dot gnu dot org>
- Date: Fri, 18 Jul 2014 11:08:17 +0200
- Subject: Re: TRIM
- Authentication-results: sourceware.org; auth=none
- References: <CANSzZf7Argujjsc_T69MkrKr7c+U=FBXdHZ+Jq7+hRz4KBjJKQ at mail dot gmail dot com> <CAMCbSMokTBOfQvV3Lsqb75DedQrkvPB5HTzmkE-UuYBrR8f2Gg at mail dot gmail dot com>
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
>