SDDSlib
Loading...
Searching...
No Matches
is_blank.c File Reference

Implementation of is_blank function. More...

#include "mdb.h"
#include <ctype.h>

Go to the source code of this file.

Functions

long is_blank (char *s)
 Determine whether a string is composed entirely of whitespace characters.
 

Detailed Description

Implementation of is_blank function.

License
This file is distributed under the terms of the Software License Agreement found in the file LICENSE included with this distribution.
Author
M. Borland, C. Saunders, R. Soliday

Definition in file is_blank.c.

Function Documentation

◆ is_blank()

long is_blank ( char * s)

Determine whether a string is composed entirely of whitespace characters.

This function checks each character in the input string to verify if it is a space character.

Parameters
sThe null-terminated string to be checked.
Returns
Returns 1 if the string is all whitespace, otherwise returns 0.

Definition at line 27 of file is_blank.c.

27 {
28 register char *ptr;
29
30 ptr = s;
31 while (*ptr && isspace(*ptr))
32 ptr++;
33 if (*ptr)
34 return (0);
35 return (1);
36}