Projet de l'école 42 : Libft
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

33 lines
1.1 KiB

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_len.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/18 16:04:47 by narnaud #+# #+# */
/* Updated: 2022/03/25 11:57:59 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#include "../libft.h"
size_t ft_strlen_to(const char *str, char ch)
{
size_t i;
i = 0;
while (str[i] && str[i] != ch)
i++;
return (i);
}
size_t ft_strlen(const char *str)
{
size_t i;
i = 0;
while (str[i] != '\0')
i++;
return (i);
}