Takes a given key and formats it in a consistent style.
Currently that style is left justified in a character variable
of minimum length key_align_width
.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | key |
pure function format_key(key)
character(len=:), allocatable :: format_key
character(len=*), intent(in) :: key
integer :: length
length = max(key_align_width, len_trim(adjustl(key)))
allocate(character(len=length)::format_key)
write(format_key, '(A)') trim(adjustl(key))
end function format_key