ft_str_is_uppercase.c

This commit is contained in:
Timo Schmidt 2023-03-19 11:13:13 +01:00
parent 9e4854ade2
commit 221d4c07ea
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_str_is_uppercase.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/19 11:03:56 by tischmid #+# #+# */
/* Updated: 2023/03/19 11:12:55 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
int ft_str_is_uppercase(char *str)
{
int i;
i = 0;
while(str[i] >= 'A' && str[i] <= 'Z')
{
++i;
}
return (str[i] == '\0');
}
/* ////
#include <stdio.h>
int main(void)
{
char s[] = "ABCDEF";
printf("%d\n", ft_str_is_uppercase(s));
return (0);
}
*/ ////