trim(3f) - [FORTRAN:INTRINSIC:CHARACTER] Remove trailing blank characters of a string
result = trim(string)
Removes trailing blank characters of a 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.
Sample program:
program demo_trim implicit none character(len=10), parameter :: s = "gfortran " write(*,*) len(s), len(trim(s)) ! "10 8", with/without trailing blanks end program demo_trim
[[Fortran 95]] and later
Transformational function
Functions that perform operations on character strings, return lengths of arguments, and search for certain arguments:
Elemental: adjustl(3), adjustr(3), index(3), len_trim(3), scan(3), verify(3) Nonelemental: repeat(3), trim(3)
trim (3) | March 11, 2021 |