Convert an array of character(1) into a character
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=1), | intent(in), | dimension(:) | :: | a | Array to convert |
New character
function arrayToChar(a) result(o)
!! Convert an array of character(1) into a character
character(1),dimension(:),intent(in)::a
!! Array to convert
character(:),allocatable::o
!! New character
integer::k
allocate(character( size(a) )::o)
do k=1,size(a)
o(k:k) = a(k)
end do
end function arrayToChar