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

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

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

Function Logic:

0:START 1:- 2:unknown 3:Return -1 4:lower upper 5:unknown 6:unknown 7:unknown 8:posn 9:Return posn

Function body:

int32_t CstrLastI (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
   //     -1   Otherwise
   int32_t n ;             //  String iterator (position)
   int32_t posn = -1;      //  Last position needle found
   char    lower ;         //  Lower case of first char of needle
   char    upper ;         //  Upper case of first char of needle
   if (!cpHaystack || !cpHaystack[0]|| !cpNeedle || !cpNeedle[0])
       return -1;
   lower = tolower(cpNeedle[0]);
   upper = toupper(cpNeedle[0]);
   for (n = 0; cpHaystack[n] ; n++)
   {
       if (cpHaystack[n] != lower && cpHaystack[n] != upper)
           continue ;
       if (!CstrCompareI(cpHaystack + n, cpNeedle))
           posn = n ;
   }
   return posn ;
}