Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ () — Coherent 3.1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


strpbrk()                String Function                strpbrk()




Find first occurrence of a character from another string

#include <string.h>
char *strpbrk(string1, string2);
char *string1, *string2;

strpbrk returns a pointer  to the first character in string1 that
matches any character in  string2.  It returns NULL if no charac-
ter in string1 matches a character in string2.

The set of characters  that string2 points to is sometimes called
the ``break string''.  For example,


        char *string = "To be, or not to be: that is the question.";
        char *brkset = ",;";
        strpbrk(string, brkset);


returns the  value of the pointer string  plus five.  This points
to the comma, which is the first character in the area pointed to
by string that matches any  character in the string pointed to by
brkset.

***** See Also *****

string functions, string.h

***** Notes *****

strpbrk resembles  the function strtok in  functionality, but un-
like strtok, it preserves  the contents of the strings being com-
pared.   It also  resembles  the function  strchr,  but lets  you
search for any one of a  group of characters, rather than for one
character alone.





















COHERENT Lexicon                                           Page 1


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026