Advertisement
Guest User

Untitled

a guest
Dec 5th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. program test
  2.     implicit none
  3.  
  4.     integer :: i
  5.     character(len=:), allocatable :: str
  6.     character, allocatable :: str_array(:)
  7.  
  8.     str = "Hello, Fortran IRC channel!"
  9.  
  10.     str_array = [(str(i:i), i = 1, len(str))]
  11.     str_array = pack(str_array, str_array /= " ")
  12.  
  13.     write(*,*) str_array
  14. end program
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement