libsim Versione 7.2.1

◆ align_center()

elemental character(len=len(input_string)) function, public 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 846 del file char_utilities.F90.

847 IF (columns_in_line + ncols_next_word <= this%ncols .OR. &
848 words_in_line == 0) THEN ! accept the word
849 columns_in_line = columns_in_line + ncols_next_word
850! now fill the paragraph
851 IF (columns_in_line <= this%ncols) THEN ! non truncated line
852 IF (words_in_line > 0) THEN ! previous space
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

Generated with Doxygen.