UtilTextFilesSortByT(String, ListSortDirection, FuncString, T, Encoding) Method
Sorts the lines of the source textfile by evaluating the result of the given condition.
Namespace: DevCase.Core.DataProcessing.TextFilesAssembly: 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
)
Public Shared Function SortBy(Of T) (
sourceFilepath As String,
sortDirection As ListSortDirection,
sortExpr As Func(Of String, T),
Optional enc As Encoding = Nothing
) As IEnumerable(Of String)
Dim sourceFilepath As String
Dim sortDirection As ListSortDirection
Dim sortExpr As Func(Of String, T)
Dim enc As Encoding
Dim returnValue As IEnumerable(Of String)
returnValue = UtilTextFiles.SortBy(sourceFilepath,
sortDirection, sortExpr, enc)
public:
generic<typename T>
static IEnumerable<String^>^ SortBy(
String^ sourceFilepath,
ListSortDirection sortDirection,
Func<String^, T>^ sortExpr,
Encoding^ enc = nullptr
)
static member SortBy :
sourceFilepath : string *
sortDirection : ListSortDirection *
sortExpr : Func<string, 'T> *
?enc : Encoding
(* Defaults:
let _enc = defaultArg enc null
*)
-> IEnumerable<string>
No code example is currently available or this language may not be supported.
- 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.
- T
IEnumerableString
An
IEnumerableT that contains the sorted lines.
This is a code example.
No code example is currently available or this language may not be supported.
Dim lines As IEnumerable(Of String) = SortBy("C:\file.txt", ListSortDirection.Ascending, Function(line As String) line.EndsWith("5"), Encoding.Default)
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
No code example is currently available or this language may not be supported.
InvalidEnumArgumentException
|
sortDirection
|