strrspn(3gen) 맨 페이지 - 윈디하나의 솔라나라

개요

섹션
맨 페이지 이름
검색(S)

strrspn(3gen)

strfind(3GEN)      String Pattern-Matching Library Functions     strfind(3GEN)

NAME
       strfind, strrspn, strtrns - string manipulations

SYNOPSIS
       cc [ 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);

DESCRIPTION
       The  strfind()  function  returns the offset of the first occurrence of
       the second string, as2, if it is a substring of string as1. If the sec‐
       ond string is not a substring of the first string strfind() returns −1.


       The strrspn() function trims characters 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.

EXAMPLES
       Example 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 = '\0';
         /* transform lowercase to uppercase */
         a1[] = "abcdefghijklmnopqrstuvwxyz";
         a2[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
         s2 = strtrns(s1, a1, a2, s2);


ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:

       tab()  box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) ATTRIBUTE TYPEAT‐
       TRIBUTE VALUE _ MT-LevelMT-Safe


SEE ALSO
       string(3C), attributes(7)

Oracle Solaris 11.4               11 May 2021                    strfind(3GEN)
맨 페이지 내용의 저작권은 맨 페이지 작성자에게 있습니다.
RSS ATOM XHTML 5 CSS3