Skip to content

Commit dd72627

Browse files
committed
Add 4
1 parent ee58fb3 commit dd72627

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

pointers_arrays_strings/4-strpbrk.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#include "main.h"
2+
3+
/**
4+
* _strpbrk - Searches a string for any of a set of bytes.
5+
* @s: The string to be searched.
6+
* @accept: The set of bytes to be searched for.
7+
*
8+
* Return: If a set is matched - a pointer to the matched byte.
9+
* If no set is matched - NULL.
10+
*/
11+
char *_strpbrk(char *s, char *accept)
12+
{
13+
int i;
14+
15+
while (*s)
16+
{
17+
for (i = 0; accept[i]; i++)
18+
{
19+
if (*s == accept[i])
20+
return (s);
21+
}
22+
23+
s++;
24+
}
25+
26+
return ('\0');
27+
}

0 commit comments

Comments
 (0)