31a898ac 1d13 6f29 5251 451cad8e23eb - akesseler/Plexdata.CsvParser GitHub Wiki

CsvContainerExtension.Sort Method (CsvContainer, String, SortOrder)

Sorts the container by column referenced by provided header and in provided sort order.

Namespace: Plexdata.CsvParser.Extensions
Assembly: Plexdata.CsvParser.NET (in Plexdata.CsvParser.NET.dll) Version: 1.1.3+d5bef99aa35461ce4bafadf0bf2c2aeca18044ea

Syntax

C#

public static void Sort(
	this CsvContainer container,
	string header,
	SortOrder order
)

Parameters

 

container
Type: Plexdata.CsvParser.Processors.CsvContainer
The container to be sorted.
header
Type: System.String
The column header to be used by sorting.
order
Type: Plexdata.CsvParser.Definitions.SortOrder
The sort order to be used.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type CsvContainer. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

This extension method sorts the container by column that is referenced by provided header and in provided sort order.

The Heading property of the container should be enabled. Because otherwise the CSV header is not excluded from sorting.

Any string is compared by using the value of property Compare.

See Also

Reference

CsvContainerExtension Class
Sort Overload
Plexdata.CsvParser.Extensions Namespace
CsvContainerExtension.Sort(CsvContainer, Int32, SortOrder)
CsvContainerExtension.GetColumn(CsvContainer, String)
CsvContainer.Compare
CsvContainer.Heading

⚠️ **GitHub.com Fallback** ⚠️