C Library Functions  - clip (3)

NAME

clip(3f) - [M_strings:WHITESPACE] trim leading and trailing blanks from a string (LICENSE:PD)

CONTENTS

Synopsis
Description
Options
Returns
Example
Author
License

SYNOPSIS

function clip(strin) result (strout)

    character(len=*),intent(in)  :: strin
    character(len=:),allocatable :: strout

DESCRIPTION

leading and trailing spaces are trimmed from the resulting string.

OPTIONS

strin input string to trim leading and trailing space characters from

RETURNS

strout clipped version of input string

EXAMPLE

Sample program:

   program demo_clip
   use M_strings, only: clip
   implicit none
   character(len=20) ::  untrimmed = ’   ABCDEFG abcdefg  ’
      write(*,*) ’untrimmed string=[’,untrimmed,’]’
      write(*,*) ’clipped string=[’,clip(untrimmed),’]’
   end program demo_clip

Expected output

     untrimmed string=[   ABCDEFG abcdefg                      ]
     clipped string=[ABCDEFG abcdefg]

AUTHOR

John S. Urban

LICENSE

Public Domain


Nemo Release 3.1 clip (3) July 22, 2023
Generated by manServer 1.08 from 47aa5b4b-acce-4093-b85b-bcb890f0f6f7 using man macros.