[UP]


Manual Reference Pages  - len_trim (3)

NAME

len_trim(3f) - [FORTRAN:INTRINSIC:CHARACTER] Length of a character entity without trailing blank characters

CONTENTS

Syntax
Description
Arguments
Return Value
Standard
Class
Example
See Also

SYNTAX

result = len_trim(string [, kind])

DESCRIPTION

Returns the length of a character string, ignoring any trailing blanks.

ARGUMENTS

STRING - Shall be a scalar of type CHARACTER, with intent(in)
KIND - (Optional) An INTEGER initialization expression indicating the kind parameter of the result.

RETURN VALUE

The return value is of type INTEGER and of kind KIND. If KIND is absent, the return value is of default integer kind.

STANDARD

[[Fortran 95]] and later, with KIND argument [[Fortran 2003]] and later

CLASS

[[Elemental procedure|Elemental function]]

EXAMPLE

Sample program

     program demo_len_trim
     character(len=:),allocatable :: string
     string=’ how long is this string?     ’
     write(*,*)’LENGTH=’,len(string)
     write(*,*)’TRIMMED LENGTH=’,len_trim(string)
     end program demo_len_trim

SEE ALSO

Functions that perform operations on character strings, return lengths of arguments, and search for certain arguments:
Elemental:
  ADJUSTL, ADJUSTR, INDEX, LEN_TRIM, SCAN, VERIFY;
Nonelemental:
  REPEAT, TRIM


len_trim (3) March 18, 2019
Generated by manServer 1.08 from b27bf4d3-706a-40e2-929c-a6e950dce47a using man macros.