-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_str_is_alpha.c
36 lines (33 loc) · 1.12 KB
/
ft_str_is_alpha.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
35
36
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_is_alpha.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: telias-p <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/03/12 18:26:17 by telias-p #+# #+# */
/* Updated: 2021/03/12 18:52:50 by telias-p ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
int ft_str_is_alpha(char *str)
{
int i;
i = 0;
while (str[i] != '\0')
{
if (str[i] >= 'a' && str[i] <= 'z')
{
i++;
}
else if (str[i] >= 'A' && str[i] <= 'Z')
{
i++;
}
else
{
return (0);
}
}
return (1);
}