libsim  Versione 7.1.7

◆ align_center()

elemental character(len=len(input_string)) function, public char_utilities::align_center ( character(len=*), intent(in)  input_string)

Returns input_string centered, i.e. with an equal number of leading and trailing blanks (±1 if they are odd).

The needed number of leading/trailing blanks is added or removed at the beginning and/or at the end in order to keep the length of the resulting string equal to the input length.

Parametri
[in]input_stringstring to be aligned

Definizione alla linea 852 del file char_utilities.F90.

853  this%paragraph(columns_in_line-ncols_next_word+1:columns_in_line,nlines+1) = &
854  transfer(' '//line(this%word_start(nw):this%word_end(nw)), this%paragraph)
855  ELSE ! no previous space
856  this%paragraph(columns_in_line-ncols_next_word+1:columns_in_line,nlines+1) = &
857  transfer(line(this%word_start(nw):this%word_end(nw)), this%paragraph)
858  ENDIF
859  ELSE ! truncated line (word longer than line)
860  this%paragraph(1:this%ncols,nlines+1) = &
861  transfer(line(this%word_start(nw):this%word_start(nw)+this%ncols-1), this%paragraph)
862  ENDIF
863  words_in_line = words_in_line + 1
864  ELSE ! refuse the word

Generated with Doxygen.