[UP]


Manual Reference Pages  - crop (3)

NAME

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

CONTENTS

Synopsis
Description
Options
Returns
Example
Author
License

SYNOPSIS

function crop(strin) result (strout)

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

DESCRIPTION

trim leading blanks from a string and return position of last non-blank character in the string.

OPTIONS

strin input string to trim leading and trailing space from

RETURNS

strout cropped version of input string

EXAMPLE

Sample program:

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

Expected output

     untrimmed string=[   ABCDEFG abcdefg                      ]
     cropped string=[ABCDEFG abcdefg]

AUTHOR

John S. Urban

LICENSE

Public Domain


crop (3) July 05, 2020
Generated by manServer 1.08 from aa11e351-0c9e-4f28-918b-70b238a5bdf4 using man macros.