We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ee58fb3 commit dd72627Copy full SHA for dd72627
pointers_arrays_strings/4-strpbrk.c
@@ -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