LenStrCmp

Compares two length-preceded ASCII strings.

Library:LibC
Service:Characters and Strings

Syntax

  #include <string.h> 
   
  int LenStrCmp (
     const char   *string1, 
     const char   *string2);
  

Parameters

string1

(IN) Points to a string to compare.

string2

(IN) Points to a string to compare.

Return Values

Returns 0 if the two strings match. Otherwise, it returns an integer less than or greater than 0, depending on whether s1 is lexicographically less than or greater than s2.

Remarks

The LenStrCmp function compares two ASCII strings preceded by a byte length. The string1 and string2 parameters are two ASCII strings with the length of the string being the first byte of the string. This function emulates the standard strcmp function but works with length-preceded strings rather than null-terminated strings.