Return the character sequence represented by the string.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(string_type), | intent(in) | :: | string | |||
| integer, | intent(in) | :: | pos |
elemental function char_string_pos(string, pos) result(character_string) type(string_type), intent(in) :: string integer, intent(in) :: pos character(len=1) :: character_string ! See len_trim_string: MERGE would evaluate `string%raw(pos:pos)` even ! for an unallocated `raw`, which is a reference to an unallocated ! allocatable. if (allocated(string%raw)) then character_string = string%raw(pos:pos) else character_string = " " end if end function char_string_pos