Determine if the supplied sub-string is contained within the supplied string on a case-sensitive basis

Return TypeFunction nameArguments
int32_tCstrFirst(const char*,const char*,)

Declared in file: hzTextproc.h
Defined in file : hzTextproc.cpp

Function Logic:

0:START 1:unknown 2:Return false 3:unknown 4:unknown 5:unknown 6:Return n 7:Return -1

Function body:

int32_t CstrFirst (const char* cpHaystack)const char* cpNeedle, 
{
   //  Category: Text Processing
   //  
   //  Determine if the supplied sub-string is contained within the supplied string on a case-sensitive basis
   //  
   //  Arguments: 1) cpHaystack The source string
   //     2) cpNeedle The string being sought
   //  
   //  Returns: Position If the sub-string occurs in the string
   //     0   Otherwise
   uint32_t    n ;     //  String iterator (position)
   if (!cpHaystack || !cpHaystack[0]|| !cpNeedle || !cpNeedle[0])
       return false ;
   for (n = 0; cpHaystack[n] ; n++)
   {
       if (cpHaystack[n] != cpNeedle[0])
           continue ;
       if (!CstrCompare(cpHaystack + n, cpNeedle))
           return n ;
   }
   return -1;
}