mirror of
https://github.com/Ladebeze66/Piscine42.git
synced 2026-11-09 13:17:16 +01:00
Piscine42
This commit is contained in:
34
C02/ex04/ft_str_is_lowercase.c
Executable file
34
C02/ex04/ft_str_is_lowercase.c
Executable file
@@ -0,0 +1,34 @@
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_str_is_lowercase.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: fgras-ca <marvin@42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/12/07 18:03:49 by fgras-ca #+# #+# */
|
||||
/* Updated: 2022/12/07 18:11:53 by fgras-ca ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_str_is_lowercase(char *str)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
if (str[i] == '\0')
|
||||
{
|
||||
return (1);
|
||||
}
|
||||
while (str[i] != '\0')
|
||||
{
|
||||
if ((str[i]) >= 97 && (str[i] <= 122))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
else
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
return (1);
|
||||
}
|
||||
Reference in New Issue
Block a user