adjustl_multi_byte Function

public pure function adjustl_multi_byte(chara) result(res)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: chara

Return Value character(len=:), allocatable


Source Code

   pure function adjustl_multi_byte(chara) result(res)
      implicit none
      character(*), intent(in) :: chara
      character(:), allocatable :: res

      integer :: i
      res = ''
      i = 1
      do while (i <= len(chara))
         if (chara(i:i) == char(0)) then
            i = i + 1
            cycle
         else
            exit
         end if
      end do

      res = chara(i:len(chara))

   end function adjustl_multi_byte