TRIM

8.249 TRIM — Remove trailing blank characters of a string

Description:
Removes trailing blank characters of a string.
Standard:
Fortran 95 and later
Class:
Transformational function
Syntax:
RESULT = TRIM(STRING)
Arguments:
STRING Shall be a scalar of type CHARACTER.
Return value:
A scalar of type CHARACTER which length is that of STRING less the number of trailing blanks.
Example:
PROGRAM test_trim
  CHARACTER(len=10), PARAMETER :: s = "GFORTRAN  "
  WRITE(*,*) LEN(s), LEN(TRIM(s))  ! "10 8", with/without trailing blanks
END PROGRAM
See also:
ADJUSTL, ADJUSTR

© Free Software Foundation
Licensed under the GNU Free Documentation License, Version 1.3.
https://gcc.gnu.org/onlinedocs/gcc-4.9.3/gfortran/TRIM.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部