blob: 81814e5205be6fb340163490a7cbbd1026aecb1d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strspn.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/10 04:29:13 by cacharle #+# #+# */
/* Updated: 2020/02/10 04:33:11 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft_str.h"
size_t ft_strspn(const char *s, const char *charset)
{
int i;
i = 0;
while (ft_strchr(charset, s[i]) != NULL)
i++;
return (i);
}
|