LEN_TRIM(STRING, KIND)

Purpose

Returns the length of the character argument without counting trailing blank characters.

Class

Elemental function

Argument type and attributes

STRING
must be of type character.
Fortran 2003 begins KIND (optional)
must be a scalar integer constant expression. Fortran 2003 ends

Result type and attributes

Result value

The result has a value equal to the number of characters remaining after any trailing blanks in STRING are removed. If the argument contains no nonblank characters, the result is zero.

Examples

LEN_TRIM ('␢A␢B␢') has the value 4. LEN_TRIM ('␢␢') has the value 0.