    '
 write(*,*)compact('  This     is      a     test  ',char=':')
 ! note CHAR is used to replace the whitespace, but if CHAR is
 ! in the original string it is just copied
 write(*,*)compact('A  AA    A   AAAAA',char='A')
 ! produces (original A characters are left as-is) 'AAAAAAAAAAAA'
 ! not 'A'
 end program demo_compact

Expected output

 &gt;This is a test
 &gt;Thisisatest
 &gt;This:is:a:test
 &gt;AAAAAAAAAAAA
</pre> <h2><a class="anchor" id="autotoc_md41"></a>
AUTHOR</h2>
<p>John S. Urban </p>
<h2>