[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]


strpbrk

Look for the first occurrence of any one of an array of characters in another.

Compatibility:

This function is compatible with the following targets:

ANSI

BeOS

EMB/RTOS

Mac OS

Palm OS

Win32


Prototype:
#include <string.h>
char *strpbrk(const char *s1, const char *s2);
Parameters:

Parameters for this facility are:

s1  
const char *  
The string being searched  
s2  
const char *  
A list of characters to search for  

Remarks:

The strpbrk() function searches the character array pointed to by s1 for the first occurrence of a character in the character array pointed to by s2.

Both s1 and s2 must point to null terminated character arrays.

Return:

strpbrk() returns a pointer to the first character in s1 that matches any character in s2, and returns a null pointer (NULL) if no match was found.

See Also:

"strcspn"

Example of strpbrk usage.:
#include <string.h>
#include <stdio.h>

int main(void)
{
	static char s1[] = "orange banana pineapple *plum";

	static char s2[] = "*%#$";
	puts(strpbrk(s1, s2));

	return 0;
}

Output:
*plum


[ First ]  [ Previous ]  [ Next ]  [ Last ]  [ Manuals ]

Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.

Last updated: August 16, 2000