|
|
1.1 root 1:
2:
3: strpbrk() String Function strpbrk()
4:
5:
6:
7:
8: Find first occurrence of a character from another string
9:
10: #include <string.h>
11: cchhaarr *ssttrrppbbrrkk(_s_t_r_i_n_g_1, _s_t_r_i_n_g_2);
12: cchhaarr *_s_t_r_i_n_g_1, *_s_t_r_i_n_g_2;
13:
14: strpbrk returns a pointer to the first character in string1 that
15: matches any character in string2. It returns NULL if no charac-
16: ter in string1 matches a character in string2.
17:
18: The set of characters that string2 points to is sometimes called
19: the ``break string''. For example,
20:
21:
22: char *string = "To be, or not to be: that is the question.";
23: char *brkset = ",;";
24: strpbrk(string, brkset);
25:
26:
27: returns the value of the pointer ssttrriinngg plus five. This points
28: to the comma, which is the first character in the area pointed to
29: by ssttrriinngg that matches any character in the string pointed to by
30: bbrrkksseett.
31:
32: ***** See Also *****
33:
34: string functions, string.h
35:
36: ***** Notes *****
37:
38: strpbrk resembles the function strtok in functionality, but un-
39: like strtok, it preserves the contents of the strings being com-
40: pared. It also resembles the function strchr, but lets you
41: search for any one of a group of characters, rather than for one
42: character alone.
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64: COHERENT Lexicon Page 1
65:
66:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.