Go to the first, previous, next, last section, table of contents.


strcspn

Syntax

#include <string.h>

size_t strcspn(const char *s1, const char *set);

Description

This function finds the first character in s1 that matches any character in set. Note that the NULL bytes at the end of each string counts, so you'll at least get a pointer to the end of the string if nothing else.

Return Value

The index of the found character.

Portability

ANSI, POSIX

Example

int i = strcspn(command, "<>|");
if (command[i])
  do_redirection();


Go to the first, previous, next, last section, table of contents.