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
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)
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)
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)
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)
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)
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)
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)
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)