-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_strpbrk.c
More file actions
31 lines (28 loc) · 1.12 KB
/
ft_strpbrk.c
File metadata and controls
31 lines (28 loc) · 1.12 KB
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
26
27
28
29
30
31
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strpbrk.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: bnoufel <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/14 07:38:56 by bnoufel #+# #+# */
/* Updated: 2020/02/14 07:39:20 by bnoufel ### ########.fr */
/* */
/* ************************************************************************** */
#include "str.h"
char *ft_strpbrk(const char *s, const char *charset)
{
size_t i;
size_t len;
char *ret;
i = 0;
len = ft_strlen(charset);
while (i < len)
{
ret = ft_strchr(s, charset[i]);
if (ret)
return (ret);
i++;
}
return (NULL);
}