Piscine42/C02/ex02/ft_str_is_alpha.c
2023-12-12 17:25:55 +01:00

35 lines
1.1 KiB
C
Executable File

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_is_alpha.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/07 14:06:49 by fgras-ca #+# #+# */
/* Updated: 2022/12/10 17:05:15 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
int ft_str_is_alpha(char *str)
{
int i;
i = 0;
if (str[i] == '\0')
{
return (1);
}
while (str[i] != '\0')
{
if ((str[i] >= 65 && str[i] <= 90) || (str[i] >= 97 && str[i] <= 122))
{
i++;
}
else
{
return (0);
}
}
return (1);
}