Checks whether or not c is a printable character - including the
space character.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=1), | intent(in) | :: | c |
The character to test. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | ic |
elemental logical function is_printable(c) character(len=1), intent(in) :: c !! The character to test. integer :: ic ic = iachar(c) !The character is printable if it's between ' ' and '~' in the ASCII table is_printable = ic >= iachar(' ') .and. ic <= int(z'7E') end function is_printable