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.
34 lines
1.1 KiB
34 lines
1.1 KiB
3 years ago
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
3 years ago
|
/* ft_len.c :+: :+: :+: */
|
||
3 years ago
|
/* +:+ +:+ +:+ */
|
||
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* Created: 2021/10/18 16:04:47 by narnaud #+# #+# */
|
||
3 years ago
|
/* Updated: 2022/03/25 11:57:59 by narnaud ### ########.fr */
|
||
3 years ago
|
/* */
|
||
|
/* ************************************************************************** */
|
||
|
|
||
|
#include "../libft.h"
|
||
|
|
||
3 years ago
|
size_t ft_strlen_to(const char *str, char ch)
|
||
3 years ago
|
{
|
||
|
size_t i;
|
||
|
|
||
|
i = 0;
|
||
3 years ago
|
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')
|
||
3 years ago
|
i++;
|
||
|
return (i);
|
||
|
}
|