Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strcspn(3) [linux man page]

STRSPN(3)						     Linux Programmer's Manual							 STRSPN(3)

NAME
strspn, strcspn - search a string for a set of characters SYNOPSIS
#include <string.h> size_t strspn(const char *s, const char *accept); size_t strcspn(const char *s, const char *reject); DESCRIPTION
The strspn() function calculates the length of the initial segment of s which consists entirely of characters in accept. The strcspn() function calculates the length of the initial segment of s which consists entirely of characters not in reject. RETURN VALUE
The strspn() function returns the number of characters in the initial segment of s which consist only of characters from accept. The strcspn() function returns the number of characters in the initial segment of s which are not in the string reject. CONFORMING TO
SVr4, 4.3BSD, C89, C99. SEE ALSO
index(3), memchr(3), rindex(3), strchr(3), string(3), strpbrk(3), strsep(3), strstr(3), strtok(3), wcscspn(3), wcsspn(3) COLOPHON
This page is part of release 3.27 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 2010-09-20 STRSPN(3)

Check Out this Related Man Page

STRSPN(3)						     Linux Programmer's Manual							 STRSPN(3)

NAME
strspn, strcspn - search a string for a set of characters SYNOPSIS
#include <string.h> size_t strspn(const char *s, const char *accept); size_t strcspn(const char *s, const char *reject); DESCRIPTION
The strspn() function calculates the length of the initial segment of s which consists entirely of characters in accept. The strcspn() function calculates the length of the initial segment of s which consists entirely of characters not in reject. RETURN VALUE
The strspn() function returns the number of characters in the initial segment of s which consist only of characters from accept. The strcspn() function returns the number of characters in the initial segment of s which are not in the string reject. CONFORMING TO
SVr4, 4.3BSD, C89, C99. SEE ALSO
index(3), memchr(3), rindex(3), strchr(3), strpbrk(3), strsep(3), strstr(3), strtok(3), wcscspn(3), wcsspn(3) COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can be found at http://www.kernel.org/doc/man-pages/. 1993-04-12 STRSPN(3)
Man Page

7 More Discussions You Might Find Interesting

1. Programming

C programming + problem with char arrays

Im trying to write some code atm which gets the complete pathname of a folder and strips off references to the parent folders. The end result should be just the name of the folder. Currently Im able to extract the folder name, however Im getting junk added onto the name as well which is making... (7 Replies)
Discussion started by: JamesGoh
7 Replies

2. Programming

Help with correct use of __fpurge()

I'm having a problem with the output of my code and I'm wondering if __fpurge() might be my solution. Here is the code: #include <stdio.h> float bonus(char x); int main() { char name; char level; float b; printf("Enter employee name: "); fgets ( name, 10, stdin );... (4 Replies)
Discussion started by: jmvbxx
4 Replies

3. Shell Programming and Scripting

converting rows into columns

Hi, I am trying to fetch some values from db and spooling the output to a file. when i query the db for the values, i get the values in following format. PC_1 wf_test1 Test PC_2 wf_test2 Test PC_3 wf_test3 Test But my spool file was created in following format. PC_1 wf_test1 Test... (20 Replies)
Discussion started by: svajhala
20 Replies

4. AIX

SMTP Server errors

Hey everyone, I have an issue where email is working fine in our Windows environments but is blowing up in our AIX environments. Here is the related functions that are getting called: int get_smtp_line( void ) { char ch = '.'; char in_data ; char * index; int retval = 0; ... (4 Replies)
Discussion started by: ctote
4 Replies

5. Programming

AIX calling WINSOCK during e-mail - normal?

Hey everyone, I'm completely stumped on this. An AIX machine I'm working on is attempting to send email, but the SMTP connection is failing. I have no idea what this code does or if it should even work. If someone could give me a hand, or a suggestion on what else to use, I would appreciate... (54 Replies)
Discussion started by: ctote
54 Replies

6. UNIX for Dummies Questions & Answers

m1join.c

Joins from pipes many to one in one pass and other tricks: $ cat mysrc/m1join.c #include <stdio.h> #include <stdlib.h> #include <strings.h> #include <limits.h> static int msep_ign = 1 ; static int fullouter = 0 ; static int leftouter = 0 ; static int rightouter = 0 ;... (0 Replies)
Discussion started by: DGPickett
0 Replies

7. IP Networking

A Basic example of socket programming in C

Hello, I have a question about socket programming The question was a homework of this university of past (2011?) course. The server is simulating a sensor that provides readings of temperature, light and humidity (temp.dat, light.dat, humid.dat) each with single column of number, one per row. ... (6 Replies)
Discussion started by: yifangt
6 Replies