strstr(3) Library Functions Manual strstr(3)NAME
strstr - Finds a substring
LIBRARY
Standard C Library (libc.so, libc.a)
SYNOPSIS
#include <string.h>
char *strstr(
const char *s1,
const char *s2);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
strstr(): ISO C, XPG4, XPG4-UNIX
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Specifies the character string being searched. Specifies the substring to be located.
DESCRIPTION
The strstr() function locates the first occurrence in the string pointed to by the s1 parameter of the sequence of bytes in the string
pointed to by the s2 parameter, excluding the terminating null character.
RETURN VALUES
On successful completion, the strstr() function returns a pointer to the located string or a null pointer if the string is not found. When
the s2 parameter points to a string having 0 (zero) length, the strstr() function returns the string pointed to by parameter s1.
RELATED INFORMATION
Functions: string(3), wcsstr(3), wcswcs(3)
Standards: standards(5) delim off
strstr(3)
Check Out this Related Man Page
wcsstr(3) Library Functions Manual wcsstr(3)NAME
wcsstr - Finds a wide-character substring
LIBRARY
Standard C Library (libc)
SYNOPSIS
#include <wchar.h>
wchar_t *wcsstr( const wchar_t *s1, const wchar_t *s2);
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
wcsstr(): XSH5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
PARAMETERS
Specifies the wide-character string being searched. Specifies the wide-character substring to be located.
DESCRIPTION
The wcsstr() function locates the first occurrence in the wide-character string pointed to by the s1 parameter of the sequence of wide
characters in the wide-character string pointed to by the s2 parameter, excluding the terminating null wide character.
RETURN VALUES
Upon successful completion, the wcsstr() function returns a pointer to the located wide-character substring or a null pointer when the sub-
string is not found. If the s2 parameter points to a wide-character substring having 0 (zero) length, the wcsstr() function returns the
entire wide-character string pointed to by parameter s1.
[Tru64 UNIX] On error, the function returns a null pointer.
RELATED INFORMATION
Functions: strstr(3), wcswcs(3)
Standards: standards(5) delim off
wcsstr(3)
I would like to get a substring of a string in command line, for example I would like to turn the string
123456789_bla.txt
to
bla
It would be also great to find the postition of a certain characer in a "_" string:
123456789_bla.txt
to
10
I hope someone can understand my... (2 Replies)
I need to pass a parameter to a function in a script. My parameter is a string. When I display the parameter within my function, I only get the first word from string I pass in.
How can I make the function receive the whole string (and not terminate at the first space it encounters)?.
part of... (1 Reply)
Hey, geniuses of the world (no--facetious is NOT the word of the day;))!
I was wondering if there's a way to extract a specific portion from a string of characters in UNIX/LINUX. Give me the generic capabilities (assuming they exist) and I'll figure out the small details.
But if you know... (8 Replies)
Can any one help with the function strstr() in Solaris unix.
The equivalent function of strstr() in Solaris Unix. This function is working in HP Unix but not in Solaris Unix. (16 Replies)