-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strpbrk.c
28 lines (25 loc) · 1.08 KB
/
ft_strpbrk.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
26
27
28
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strpbrk.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: thakala <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/28 12:22:39 by thakala #+# #+# */
/* Updated: 2021/11/28 16:33:55 by thakala ### ########.fr */
/* */
/* ************************************************************************** */
#include <string.h>
char *ft_strpbrk(const char *s, const char *charset)
{
size_t c;
--s;
while (*++s)
{
c = 0;
while (charset[c])
if (charset[c++] == *s)
return ((char *)s);
}
return (NULL);
}