This commit is contained in:
Camille Chauvet
2023-05-17 16:45:25 +00:00
commit 29ed24d567
619 changed files with 16119 additions and 0 deletions

View File

@ -0,0 +1,42 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_is_alpha.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/17 13:51:45 by cchauvet #+# #+# */
/* Updated: 2022/07/19 13:06:32 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
int ft_str_is_alpha(char *str)
{
while (*str != 0)
{
if (!(('a' <= *str && *str <= 'z') || ('A' <= *str && 'Z' >= *str)))
{
return (0);
}
str++;
}
return (1);
}
/*
#include <unistd.h>
void ft_putchar(char c)
{
write(1, &c, 1);
}
int main(void)
{
ft_putchar(ft_str_is_alpha("ff")+'0');
ft_putchar(ft_str_is_alpha("dfdf5f")+'0');
ft_putchar(ft_str_is_alpha("GDGFSGF")+48);
ft_putchar(ft_str_is_alpha("FG5DG")+48);
ft_putchar(ft_str_is_alpha("")+48);
}
*/