piscine-c02/ex02/ft_str_is_alpha.c

35 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_is_alpha.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/19 10:33:26 by tischmid #+# #+# */
/* Updated: 2023/03/19 11:04:39 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
int ft_str_is_alpha(char *str)
{
int i;
i = 0;
while ((str[i] | 32) >= 'a' && (str[i] | 32) <= 'z')
{
++i;
}
return (str[i] == '\0');
}
/* ////
#include <stdio.h>
int main(void)
{
char s[] = "";
printf("%d\n", ft_str_is_alpha(s));
return (0);
}
*/ ////