Removes trailing blank characters of a string.
Fortran 95 and later
Transformational function
RESULT = TRIM(STRING)
STRING | Shall be a scalar of type CHARACTER . |
A scalar of type CHARACTER
which length is that of STRING less the number of trailing blanks.
PROGRAM test_trim CHARACTER(len=10), PARAMETER :: s = "GFORTRAN " WRITE(*,*) LEN(s), LEN(TRIM(s)) ! "10 8", with/without trailing blanks END PROGRAM
© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-7.2.0/gfortran/TRIM.html