1
0

first commit

This commit is contained in:
KeyZox
2023-08-06 20:12:38 +02:00
parent 1fe062c970
commit eb6b113e51
125 changed files with 2987 additions and 0 deletions

View File

@ -0,0 +1,40 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strcapitalize.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ajoly <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/07/19 19:09:13 by ajoly #+# #+# */
/* Updated: 2022/07/19 19:09:17 by ajoly ### ########.fr */
/* */
/* ************************************************************************** */
char *ft_strcapitalize(char *str)
{
int i;
i = 0;
while (str[i] != '\0')
{
if (str[i] >= 'a' && str[i] <= 'z')
{
if (str[i - 1] <= 47 || str[i - 1] == 0
|| (str[i - 1] >= 58 && str[i - 1] <= 64)
|| (str[i - 1] >= 91 && str[i - 1] <= 96)
|| (str[i - 1] >= 123 && str[i - 1] <= 126))
{
str[i] -= 32;
}
}
if (str[i] >= 'A' && str[i] <= 'Z')
{
if (str[i - 1] > 47)
{
str[i] += 32;
}
}
i++;
}
return (str);
}