pad_left Function

private pure function pad_left(text, width) result(string)

Blank pad on the left, widening rather than truncating.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: text
integer(kind=default_int), intent(in) :: width

Return Value character(len=:), allocatable


Called by

proc~~pad_left~~CalledByGraph proc~pad_left pad_left proc~to_string_width_i32 to_string_width_i32 proc~to_string_width_i32->proc~pad_left proc~to_string_width_i64 to_string_width_i64 proc~to_string_width_i64->proc~pad_left interface~to_string_width to_string_width interface~to_string_width->proc~to_string_width_i32 interface~to_string_width->proc~to_string_width_i64

Source Code

   pure function pad_left(text, width) result(string)
      !! Blank pad on the left, widening rather than truncating.
      character(len=*), intent(in) :: text
      integer(default_int), intent(in) :: width
      character(len=:), allocatable :: string

      if (width > len(text)) then
         string = repeat(" ", width - len(text))//text
      else
         string = text
      end if

   end function pad_left