# Fortran Wiki adjustl

## Description

adjustl(string) will left adjust a string by removing leading spaces. Spaces are inserted at the end of the string as needed.

## Standard

Fortran 95 and later

## Class

Elemental function

## Syntax

result = adjustl(string)

## Arguments

• string - the type shall be character.

## Return value

The return value is of type character and of the same kind as string where leading spaces are removed and the same number of spaces are inserted on the end of string.

## Example

program test_adjustl
character(len=20) :: str = '   gfortran'
str = adjustl(str)
print *, str
end program test_adjustl

## See also

category: intrinsics