Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

strspn(3) [netbsd man page]

STRSPN(3)						   BSD Library Functions Manual 						 STRSPN(3)

NAME
strspn -- span a string LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <string.h> size_t strspn(const char *s, const char *charset); DESCRIPTION
The strspn() function spans the initial part of the nul-terminated string s as long as the characters from s occur in string charset. RETURN VALUES
The strspn() function returns the number of characters spanned. EXAMPLES
The following call to strspn() will return 3, since the first three characters of string s are part of string charset: char *s = "foobar"; char *charset = "of"; size_t span; span = strspn(s, charset); SEE ALSO
index(3), memchr(3), rindex(3), strchr(3), strcspn(3), strpbrk(3), strrchr(3), strsep(3), strstr(3), strtok(3) STANDARDS
The strspn() function conforms to ANSI X3.159-1989 (``ANSI C89''). BSD
August 11, 2002 BSD

Check Out this Related Man Page

STRSPN(3)						   BSD Library Functions Manual 						 STRSPN(3)

NAME
strspn, strcspn -- span a string LIBRARY
Standard C Library (libc, -lc) SYNOPSIS
#include <string.h> size_t strspn(const char *s, const char *charset); size_t strcspn(const char *s, const char *charset); DESCRIPTION
The strspn() function spans the initial part of the null-terminated string s as long as the characters from s occur in the null-terminated string charset. In other words, it computes the string array index of the first character of s which is not in charset, else the index of the first null character. The strcspn() function spans the initial part of the null-terminated string s as long as the characters from s do not occur in the null-ter- minated string charset (it spans the complement of charset). In other words, it computes the string array index of the first character of s which is also in charset, else the index of the first null character. RETURN VALUES
The strspn() and strcspn() functions return the number of characters spanned. SEE ALSO
memchr(3), strchr(3), strpbrk(3), strrchr(3), strsep(3), strstr(3), strtok(3), wcsspn(3) STANDARDS
The strspn() and strcspn() functions conform to ISO/IEC 9899:1990 (``ISO C90''). BSD
May 24, 2014 BSD
Man Page

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

designing a shell

Hi I need to expand some shell code so it would be able to do more than it is doing now. Currently it can do stuff like quit when q is pressed, display a prompt but not much more. I have to make the shell have capabilities like cd (changing directories) redirection of input and output, for... (2 Replies)
Discussion started by: newtoallthis
2 Replies

2. Programming

stupid question about ascii characters

i know it's out there, but I cannot remember how to check if a given ascii character string contains all digits or not ... any ideas? ie...function("123") --> OK function("NOT_A_NUMBER") --> returns error thanks!! (2 Replies)
Discussion started by: jalburger
2 Replies

3. Programming

C program in Unix / Linux - Time differences

Hi Friends, When Iam running c program in redhat linux 7.3 version and PCQ Linux 8.0 version, its taking around 20 seconds. But when Iam running it in HP-UX Release 11i, its taking around 3 minutes. Can anyone throw light on this. Thanks in advance, Praveen. (11 Replies)
Discussion started by: chprvkmr
11 Replies

4. Programming

substituting one string for another

I have a Linux C program I'm writing that has one section where, within a large string, I need to substitute a smaller string for another, and those probably won't be the same size. For instance, if I have a string: "Nowisthetimeforallgoodmen" and I want to substitute 'most' for 'all' the... (2 Replies)
Discussion started by: cleopard
2 Replies

5. 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

6. Homework & Coursework Questions

Splitting a numbers binary representation for a double.

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Split a 64bit hexadecimal number into two 32 bit numbers or keys. 2. Relevant commands, code, scripts,... (5 Replies)
Discussion started by: robin_simple
5 Replies

7. Shell Programming and Scripting

C command not found

Dear All, I am trying to install a program in Opensuse linux and while issuing the 'make' command, its showing me an error /bin/sh: C: command not found Kindly help me to troubleshoot the problem. I have gcc, c++ all install in the linux machine. Thanks (9 Replies)
Discussion started by: biochemist
9 Replies

8. Programming

Wildcard Pattern Matching In C

I've been having problems lately trying to do pattern matching in C while implementing wildcards. Take for instance the following code: #include <sys/types.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <dirent.h> #include <string.h> ... (14 Replies)
Discussion started by: Azrael
14 Replies