ssttrrcchhrr() -- String Function (libc)

Find a character in a string
#iinncclluuddee <ssttrriinngg.hh>
cchhaarr *ssttrrcchhrr(_s_t_r_i_n_g, _c_h_a_r_a_c_t_e_r)
cchhaarr *_s_t_r_i_n_g; iinntt _c_h_a_r_a_c_t_e_r;

ssttrrcchhrr() searches for the  first occurrence of _c_h_a_r_a_c_t_e_r within _s_t_r_i_n_g. The
null character at  the end of _s_t_r_i_n_g is included  within the search.  It is
equivalent to the COHERENT function iinnddeexx().

ssttrrcchhrr()  returns a  pointer to  the first  occurrence of  _c_h_a_r_a_c_t_e_r within
_s_t_r_i_n_g. If _c_h_a_r_a_c_t_e_r is not found, it returns NULL.

Having ssttrrcchhrr()  search for a null character will  always produce a pointer
to the end of a string.  For example,

    char *string;
    assert(strchr(string, '\0') == string + strlen(string));

never fails.

_S_e_e _A_l_s_o
lliibbcc, ssttrriinngg.hh
ANSI Standard, section 7.11.5.2
POSIX Standard, section 8.1
