-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_strlowcase.c
40 lines (36 loc) · 1.27 KB
/
ft_strlowcase.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strlowcase.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: davgalle <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/07/17 17:03:06 by davgalle #+# #+# */
/* Updated: 2023/07/17 17:45:37 by davgalle ### ########.fr */
/* */
/* ************************************************************************** */
#include<stdio.h>
#include<unistd.h>
#include<string.h>
char *ft_strlowcase(char *str)
{
unsigned int i;
i = 0;
while (str[i] != '\0')
{
if (str[i] >= 'a' && str[i] <= 'z')
i++;
if (str[i] >= 'A' && str[i] <= 'Z')
str[i] = str[i] + 32;
i++;
}
return (str);
}
/*
int main(void)
{
char str[] = "HOLA CACHORRILLOS";
*ft_strlowcase(str);
printf("%s", ft_strlowcase(str));
return (0);
}*/