## String::CompareOrdinal(const String\&, const String\&) method


使用序数模式的小于-等于-大于比较两个字符串。

```cpp
static int System::String::CompareOrdinal(const String &strA, const String &strB)
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| strA | const String\& | 要比较的第一个字符串。 |
| strB | const String\& | 要比较的第二个字符串。 |

### ReturnValue

如果第一个子字符串小于第二个，则返回负值；如果相等则返回零；否则返回正值。

## 另见

* Class [String](../)
* Class [String](../)
* Namespace [System](../../)
* Library [Aspose.Page for C++](../../../)
## String::CompareOrdinal(const String\&, int, const String\&, int, int) method


使用序数模式的小于-等于-大于比较两个字符串。

```cpp
static int System::String::CompareOrdinal(const String &strA, int indexA, const String &strB, int indexB, int length)
```


| Parameter | Type | 描述 |
| --- | --- | --- |
| strA | const String\& | 要比较的第一个字符串。 |
| indexA | int | 第一个字符串子串的起始位置。 |
| strB | const String\& | 要比较的第二个字符串。 |
| indexB | int | 第二个字符串子串的起始位置。 |
| length | int | 要比较的字符数。 |

### ReturnValue

如果第一个子字符串小于第二个，则返回负值；如果相等则返回零；否则返回正值。

## 另见

* Class [String](../)
* Class [String](../)
* Namespace [System](../../)
* Library [Aspose.Page for C++](../../../)
