Query: str
OS: opensolaris
Section: 3gen
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
strfind(3GEN) String Pattern-Matching Library Functions strfind(3GEN)NAMEstrfind, strrspn, strtrns, str - string manipulationsSYNOPSIScc [ flag ... ] file ... -lgen [ library ... ] #include <libgen.h> int strfind(const char *as1, const char *as2); char *strrspn(const char *string, const char *tc); char * strtrns(const char *string, const char *old, const char *new, char *result);DESCRIPTIONThe strfind() function returns the offset of the first occurrence of the second string, as2, if it is a substring of string as1. If the second string is not a substring of the first string strfind() returns -1. The strrspn() function trims chartacters from a string. It searches from the end of string for the first character that is not contained in tc. If such a character is found, strrspn() returns a pointer to the next character; otherwise, it returns a pointer to string. The strtrns() function transforms string and copies it into result. Any character that appears in old is replaced with the character in the same position in new. The new result is returned.USAGEWhen compiling multithreaded applications, the _REENTRANT flag must be defined on the compile line. This flag should only be used in mul- tithreaded applications.EXAMPLESExample 1 An example of the strfind() function. /* find offset to substring "hello" within as1 */ i = strfind(as1, "hello"); /* trim junk from end of string */ s2 = strrspn(s1, "*?#$%"); *s2 = ' '; /* transform lower case to upper case */ a1[] = "abcdefghijklmnopqrstuvwxyz"; a2[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; s2 = strtrns(s1, a1, a2, s2);ATTRIBUTESSee attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+SEE ALSOstring(3C), attributes(5) SunOS 5.11 20 Jan 1999 strfind(3GEN)
Related Man Pages |
---|
strfind(3gen) - opensolaris |
strcadd(3gen) - sunos |
strccpy(3gen) - sunos |
streadd(3gen) - sunos |
strtrns(3gen) - opensolaris |
Similar Topics in the Unix Linux Community |
---|
String manupulations... |
Using ls on multiple directories |
Using ls on multiple directories |
extran NUll character added after end of line "\n" |
How to see junk character in file in.? |