Share

AcString::compare

C++

Adesk::Int32 compare(
    const char * psz, 
    Encoding encoding
) const;

Description

Compares the string to a string of narrow characters.

Parameters

Parameters Description
psz Input pointer to the string of narrow characters to compare to
encoding Input Encoding type

Returns

0 if this string equals psz, a value < 0 if this string is less than psz and a value > 0 if this string is greater than psz.

Remarks

Currently, only Utf8 encoding is supported.

Links

AcString

Previous Declaration

AutoCAD 2017 through AutoCAD 2024

ACBASE_PORT int compare(const char *psz, Encoding encoding) const;

AutoCAD 2016 and earlier

ACBASE_PORT int compare(const char * psz) const;

History

AutoCAD 2025

Function now returns Adesk::Int32 instead of int.

AutoCAD 2017

encoding argument was added.

Was this information helpful?