ispunct(3f) - [M_strings:COMPARE] returns .true. if character is a printable punctuation character (LICENSE:PD)
Synopsis
Description
Options
Returns
Examples
Author
License
elemental function ispunct(onechar)
character,intent(in) :: onechar logical :: ispunct
ispunct(3f) returns .true. if character is a printable punctuation character
onechar character to test
ispunct logical value returns true if character is a printable punctuation character.
Sample program:
program demo_ispunct use M_strings, only : ispunct implicit none integer :: i character(len=1),parameter :: string(*)=[(char(i),i=0,127)] write(*,(20(g0,1x)))ISPUNCT: , & & iachar(pack( string, ispunct(string) )) write(*,(20(g0,1x)))ISPUNCT: , & & pack( string, ispunct(string) ) end program demo_ispunctResults:
ISPUNCT: 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 58 59 60 61 62 63 64 91 92 93 94 95 96 123 124 125 126 ISPUNCT: ! " # $ % & ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ { | } ~
John S. Urban
Public Domain
Nemo Release 3.1 | ispunct (3m_strings) | January 10, 2025 |