45 lines
1.3 KiB
C
45 lines
1.3 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_str_is_alpha.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: whaffman <whaffman@student.codam.nl> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/06/06 14:06:00 by whaffman #+# #+# */
|
|
/* Updated: 2024/06/06 14:35:19 by whaffman ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
int ft_str_is_alpha(char *str)
|
|
{
|
|
int is_alpha;
|
|
|
|
is_alpha = 1;
|
|
while (*str != '\0')
|
|
{
|
|
if (*str < 'A' \
|
|
|| (*str > 'Z' && *str < 'a') \
|
|
|| *str > 'z')
|
|
{
|
|
is_alpha = 0;
|
|
}
|
|
str++;
|
|
}
|
|
return (is_alpha);
|
|
}
|
|
/*
|
|
#include <stdio.h>
|
|
int main(void)
|
|
{
|
|
char *s1 = "";
|
|
char *s2 = "adsf";
|
|
char *s3 = "asdfgr3asdf";
|
|
printf("%d, %d, %d", \
|
|
ft_str_is_alpha(s1),
|
|
ft_str_is_alpha(s2),
|
|
ft_str_is_alpha(s3));
|
|
|
|
return (0);
|
|
}
|
|
*/
|