C Library Functions  - dilate (3)

NAME

dilate(3f) - [M_strings:NONALPHA] expand tab characters (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Results
Examples
Author
License

SYNOPSIS

function dilate(INSTR) result(OUTSTR)

    character(len=*),intent=(in)  :: INSTR
    character(len=:),allocatable  :: OUTSTR

DESCRIPTION

dilate() converts tabs in INSTR to spaces in OUTSTR.
  It assumes a tab is set every 8 characters. Trailing spaces are removed.
In addition, trailing carriage returns and line feeds are removed (they are usually a problem created by going to and from MSWindows).

OPTIONS

instr Input line to remove tabs from

RESULTS

outstr Output string with tabs expanded.

EXAMPLES

Sample program:

   program demo_dilate

use M_strings, only : dilate, visible implicit none character(len=:),allocatable :: in 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) == ’ ’)in(i:i)=char(9) enddo write(*,’("[",a,"]")’)visible(in) write(*,’("[",a,"]")’)visible(dilate(in)) end program demo_dilate

Results:

   > [^I^Ithis^Iis^Imy^Istring^I^I]
   > [                this    is      my      string]

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 dilate (3) July 22, 2023
Generated by manServer 1.08 from 84e1d6d8-d07b-4481-834f-7dedb0f944f0 using man macros.