all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,18 @@
|
|||
Imports System
|
||||
|
||||
Module Sorting_Using_a_Custom_Comparator
|
||||
Function CustomComparator(ByVal x As String, ByVal y As String) As Integer
|
||||
Dim result As Integer
|
||||
result = y.Length - x.Length
|
||||
If result = 0 Then
|
||||
result = String.Compare(x, y, True)
|
||||
End If
|
||||
Return result
|
||||
End Function
|
||||
|
||||
Sub Main()
|
||||
Dim strings As String() = {"test", "Zoom", "strings", "a"}
|
||||
|
||||
Array.Sort(strings, New Comparison(Of String)(AddressOf CustomComparator))
|
||||
End Sub
|
||||
End Module
|
||||
Loading…
Add table
Add a link
Reference in a new issue