Loading...
Searching...
No Matches
trim

Definition

Remove trailing blanks from a string object.

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

The result is returned as a deferred-length intrinsic character expression with trailing blanks removed.

If the string is not allocated, an empty character string is returned.

Examples

Basic usage:

type(string) :: s
character(:), allocatable :: c
s = 'hello '
c = trim(s)
print *, '' !

Unallocated strings:

type(string) :: s
print *, len(trim(s)) ! 0
Returns
Deferred-length character string without trailing blanks.

Definition at line 240 of file string.f90.


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

Methods

◆ string_trim()

pure character(:) function, allocatable string_trim ( class(string), intent(in) this)

Returns a copy of the string with trailing blanks removed.

Parameters
[in]thisstring
Returns
Trimmed character string (deferred length).

Definition at line 500 of file string.f90.