ADJUSTR (The GNU Fortran Compiler)

### 8.11 `ADJUSTR` — Right adjust a string ¶

Synopsis:

  `RESULT = ADJUSTR(STRING)`

Description:

  `ADJUSTR(STRING)` right adjusts a string by removing trailing spaces. Spaces are inserted at the start of the string as needed.

Class:

  Elemental function

Arguments:

  STR | The type shall be `CHARACTER`.

Return value:

  The return value is of type `CHARACTER` and of the same kind as STRING where trailing spaces are removed and the same number of spaces are inserted at the start of STRING.

Example:

      program test_adjustr
        character(len=20) :: str = 'gfortran'
        str = adjustr(str)
        print *, str
      end program test_adjustr

Standard:

  Fortran 90 and later

See also:

  `ADJUSTL` — Left adjust a string,
  `TRIM` — Remove trailing blank characters of a string