Blank pad on the left, widening rather than truncating.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | text | |||
| integer(kind=default_int), | intent(in) | :: | width |
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