-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_len_untill.c
25 lines (22 loc) · 1.05 KB
/
ft_len_untill.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_len_untill.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edelangh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2014/11/27 19:28:22 by edelangh #+# #+# */
/* Updated: 2015/01/08 10:52:29 by edelangh ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
size_t ft_len_untill(const char *str, char c)
{
size_t len;
len = 0;
if (!str)
return (0);
while (str[len] != c && str[len] != '\0')
++len;
return (len);
}