Loading...
Searching...
No Matches
len_trim

Definition

Return the trimmed length of a string object.

This generic interface extends the intrinsic Fortran len_trim function to support the fpx string type.

The returned value corresponds to the number of characters after removing trailing blanks.

If the string is not allocated, the returned value is zero.

Examples

Basic usage:

type(string) :: s
s = 'foo'
print *, len_trim(s) ! 3
s = 'foo '
print *, len_trim(s) ! 3

Unallocated strings:

type(string) :: s
print *, len_trim(s) ! 0

Definition at line 201 of file string.f90.


The documentation for this interface was generated from the following file:

Methods

◆ string_len_trim()

pure integer function string_len_trim ( class(string), intent(in) this)

Length of the string entity without trailing blanks (len_trim).

Parameters
[in]thisstring

Examples

type(string) :: s
integer :: l
s = string('foo ')
l = len_trim(s)
! the value of l is 3
Returns
An integer corresponding to the trimmed length of the string.

Definition at line 485 of file string.f90.