Str_Str_N()

Finds the first occurrence of a specific string within another string, up to a maximum number of characters.

Files

lib_str.h/lib_str.c

Prototype

          CPU_CHAR  *Str_Str_N (const  CPU_CHAR    *pstr,
                                const  CPU_CHAR    *pstr_srch,
                                       CPU_SIZE_T   len_max);

Arguments

pstr

Pointer to the string to search for the specified string.

pstr_srch

Pointer to the string to search for in the string.

len_max

Maximum number of string characters to search.

Returned Value

Pointer to first occurrence of search string in string, if specified string found in search string and no errors.

Pointer to search string, if specified string is zero-length NULL-string.

Pointer to NULL, otherwise.

Required Configuration

None.

Notes / Warnings

String buffers not modified.

String search terminates if string pointer points to or overlaps the NULL address.

Example Usage

          CPU_CHAR  *pstr;


          pstr = Str_Str_N("Hello World!", "lo", 10u);