forked from josanri/Libft_extended
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_isnot_empty_str.c
34 lines (32 loc) · 1.32 KB
/
ft_isnot_empty_str.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isempty.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aalvarez <aalvarez@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/08/21 21:02:27 by aalvarez #+# #+# */
/* Updated: 2022/09/24 13:38:22 by aalvarez ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
/**
* @brief checks if the string pointed by str has at least onw character
* that differs from a space bar or its significants.
*
* @param str the string to be evaluated.
* @return int 1 if it finds a character differing from printable char, 0
* otherwise.
*/
int ft_isnot_empty_str(const char *str)
{
if (!str)
return (0);
while (*str)
{
if (ft_isprint(*str) && !ft_isspace(*str))
return (1);
str++;
}
return (0);
}