UtilTextFilesSortByT(String, ListSortDirection, FuncString, T, Encoding) Method

Sorts the lines of the source textfile by evaluating the result of the given condition.

Definition

Namespace: DevCase.Core.DataProcessing.TextFiles
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
public static IEnumerable<string> SortBy<T>(
	string sourceFilepath,
	ListSortDirection sortDirection,
	Func<string, T> sortExpr,
	Encoding enc = null
)

Parameters

sourceFilepath  String
The source textfile path.
sortDirection  ListSortDirection
The sorting direction.
sortExpr  FuncString, T
The sorting expression to evaluate.
enc  Encoding  (Optional)
The file encoding used to read the textfile.

Type Parameters

T

Return Value

IEnumerableString
An IEnumerableT that contains the sorted lines.

Example

This is a code example.
C#
No code example is currently available or this language may not be supported.

Exceptions

InvalidEnumArgumentException sortDirection

See Also