Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(string), | intent(in) | :: | lhs | Left hand side. |
||
type(string), | intent(in) | :: | rhs | Right hand side. |
Concatenated string.
Concatenation with string.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(kind=CK,len=:), | public, | allocatable | :: | temporary | Temporary concatenated string. |
elemental function string_concat_string_string(lhs, rhs) result(concat)
!---------------------------------------------------------------------------------------------------------------------------------
!< Concatenation with string.
!---------------------------------------------------------------------------------------------------------------------------------
class(string), intent(in) :: lhs !< Left hand side.
type(string), intent(in) :: rhs !< Right hand side.
type(string) :: concat !< Concatenated string.
character(kind=CK, len=:), allocatable :: temporary !< Temporary concatenated string.
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
temporary = ''
if (allocated(lhs%raw)) temporary = lhs%raw
if (allocated(rhs%raw)) temporary = temporary//rhs%raw
if (temporary/='') concat%raw = temporary
return
!---------------------------------------------------------------------------------------------------------------------------------
endfunction string_concat_string_string