[UP]


Manual Reference Pages  - nospace (3)

NAME

nospace(3f) - [M_strings:WHITESPACE] remove all whitespace from input string (LICENSE:PD)

CONTENTS

Synopsis
Description
Examples
Author
License

SYNOPSIS

function nospace(str) - remove all whitespace from input string

    character(len=*),intent(in)          :: str
    character(len=:),allocatable         :: nospace

DESCRIPTION

nospace(3f) removes space, tab, carriage return, new line, vertical tab, formfeed and null characters (called "whitespace"). The output is returned trimmed.

EXAMPLES

Sample program:

    program demo_nospace
    use M_strings, only: nospace
    implicit none
    character(len=:),allocatable  :: s
       s=’  This     is      a     test  ’
       write(*,*) ’original input string is ....’,s
       write(*,*) ’processed output string is ...’,nospace(s)
       if(nospace(s).eq.’Thisisatest’)then
          write(*,*)’nospace test passed’
       else
          write(*,*)’nospace test error’
       endif
    end program demo_nospace

Expected output

    original input string is ....  This     is      a     test
    processed output string is ...Thisisatest
    nospace test passed

AUTHOR

John S. Urban

LICENSE

Public Domain


nospace (3) March 11, 2021
Generated by manServer 1.08 from 07b26171-9c79-487a-9e3d-edb8e28b1b41 using man macros.