dilate(3f) - [M_strings:NONALPHA] expand tab characters (LICENSE:PD)
Synopsis
Description
Options
Results
Examples
Author
License
function dilate(INSTR) result(OUTSTR)
character(len=*),intent=(in) :: INSTR character(len=:),allocatable :: OUTSTR
In addition, trailing carriage returns and line feeds are removed (they are usually a problem created by going to and from MSWindows).
dilate() converts tabs in INSTR to spaces in OUTSTR. It assumes a tab is set every 8 characters. Trailing spaces are removed.
instr Input line to remove tabs from
outstr Output string with tabs expanded.
Sample program:
program demo_dilate! test filter to remove tabs and trailing white space from input ! on files up to 1024 characters wide use M_strings, only : dilate implicit none character(len=:),allocatable :: in character(len=:),allocatable :: out integer :: i in= this is my string ! change spaces to tabs to make a sample input do i=1,len(in) if(in(i:i).eq. )in(i:i)=char(9) enddo write(*,(a))in,dilate(in) end program demo_dilate
John S. Urban
Public Domain
dilate (3) | March 11, 2021 |