Show / Hide Table of Contents

Class NumericStringComparer

Compare strings preserving natural number sorting, i.e. "item_2" comes before "item_10".

Inheritance
System.Object
NumericStringComparer
Implements
System.Collections.Generic.IComparer<System.String>
Namespace: sttz.Trimmer.Extensions
Assembly: Trimmer.dll
Syntax
public sealed class NumericStringComparer : IComparer<string>
Remarks

Based on this Stackoverflow answer by Drew Noakes: https://stackoverflow.com/a/41168219/202741

Properties

| Improve this Doc View Source

Instance

Declaration
public static NumericStringComparer Instance { get; }
Property Value
Type Description
NumericStringComparer

Methods

| Improve this Doc View Source

Compare(String, String)

Declaration
public int Compare(string x, string y)
Parameters
Type Name Description
System.String x
System.String y
Returns
Type Description
System.Int32

Implements

System.Collections.Generic.IComparer<T>
  • Improve this Doc
  • View Source
Back to top © 2017 Adrian Stutz