strncmp_off
Valid for: CANoe DE • CANoe:lite DE • CANoe4SW DE • CANoe4SW:lite DEFunction Syntax
Description
This function compares s1 with s2 for a maximum of len bytes. If they are identical the functional result is 0.If s1 is less than s2 the result is -1, else +1.
Comparison starts in s1 at s1offset and in s2 at s2offset. Note: A character may need several bytes depending on the string encoding, e.g. Japanese characters in Windows ANSI (932) encoding or any special characters in UTF-8 encoding. In that case, you should use mbstrncmp_off instead.
Parameters
- s1: First string
- s2: Second string
- s1offset: Offset in s1 in bytes
- s2offset: Offset in s2 in bytes
- len: Maximum number of bytes to compare
Return Values
- -1: if s1 is less than s2
- 1: if s2 is less than s1
- 0: if the strings are equal