ft_strlowcase.c

This commit is contained in:
Timo Schmidt 2023-03-19 11:27:14 +01:00
parent cd2f992fbd
commit 7d4fe515b9
1 changed files with 36 additions and 0 deletions

36
ex08/ft_strlowcase.c Normal file
View File

@ -0,0 +1,36 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlowcase.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tischmid <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/19 11:18:13 by tischmid #+# #+# */
/* Updated: 2023/03/19 11:27:10 by tischmid ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strlowcase(char *str)
{
int i;
i = -1;
while (str[++i] != '\0')
if (str[i] >= 'A' && str[i] <= 'Z')
str[i] = str[i] | 32;
return (str);
}
/* ////
#include <stdio.h>
int main(void)
{
char s1[] = "hEllO worLd";
char *s2;
printf("%s\n", s1);
s2 = ft_strlowcase(s1);
printf("%s\n", s2);
return (0);
}
*/ ////