isblank Function

public elemental function isblank(ch) result(res)

NAME

 isblank(3f) - [M_strings:COMPARE] returns .true. if character is a
 blank character (space or horizontal tab).
 (LICENSE:PD)

SYNOPSIS

elemental function isblank(onechar)

 character,intent(in) :: onechar
 logical              :: isblank

DESCRIPTION

 isblank(3f) returns .true. if character is a blank character (space
 or horizontal tab).

OPTIONS

onechar  character to test

RETURNS

isblank  logical value returns true if character is a "blank"
         ( an ASCII  space or horizontal tab character).

EXAMPLE

Sample program:

 program demo_isblank
 use M_strings, only : isblank
 implicit none
 integer                    :: i
 character(len=1),parameter :: string(*)=[(char(i),i=0,127)]
    write(*,'(*(g0,1x))')'ISXBLANK: ',&
    & iachar(pack( string, isblank(string) ))
 end program demo_isblank

Results:

ISXBLANK:  9 32

AUTHOR

 John S. Urban

LICENSE

 Public Domain

Arguments

Type IntentOptional Attributes Name
character, intent(in) :: ch

Return Value logical


Contents

Source Code


Source Code

elemental function isblank(ch) result(res)

! ident_70="@(#) M_strings isblank(3f) returns .true. if character is a blank (space or horizontal tab)"

character,intent(in) :: ch
logical              :: res
   select case(ch)
   case(' ',char(9))
     res=.true.
   case default
     res=.false.
   end select
end function isblank