NumericStringComparer(T) Class
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
Represents a numeric string comparison operation that uses special
case-insensitive comparison rules for strings with numeric values.
Inheritance Hierarchy
SystemObject
System.Collections.GenericComparerT
OSIsoft.AFNumericStringComparerT
System.Collections.GenericComparerT
OSIsoft.AFNumericStringComparerT
Namespace: OSIsoft.AF
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public sealed class NumericStringComparer<T> : Comparer<T>
Public NotInheritable Class NumericStringComparer(Of T) Inherits Comparer(Of T) Dim instance As NumericStringComparer(Of T)
generic<typename T> public ref class NumericStringComparer sealed : public Comparer<T>
[<SealedAttribute>] type NumericStringComparer<'T> = class inherit Comparer<'T> end
Type Parameters
- T
- The type of objects to compare.
The NumericStringComparerT type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| NumericStringComparerT |
Initializes a new instance of the NumericStringComparerT class
which sorts in ascending order.
| |
| NumericStringComparerT(Boolean) |
Initializes a new instance of the NumericStringComparerT class
which allows the sort order to be specified.
|
Methods
| Name | Description | |
|---|---|---|
| Compare |
Compares two objects and returns an indication of their
relative sort order.
(Overrides ComparerTCompare(T, T).) | |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
| GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| ToString | Returns a string that represents the current object. (Inherited from Object.) |
Remarks
The numeric string comparison operation will sort strings containing
numeric values using a numeric compare. Instead of the alpha-numeric
order of A1, A10, A11, A2, the order would be A1, A2, A10, A11.
| This sort may produce unexpected results when the NumberFormatInfo of the current culture is configured to use multiple characters for the NumberDecimalSeparator, NumberGroupSeparator, PositiveSign, or NegativeSign properties. |