So i have created a program ,that takes a certain list of lines and reads the first 21 letters[Date - Time(01.02.2015 - 18:30:25)] from every line and split them. Now i want to check every line and and sort it depending on date (Newer to older).
What I have tried: I created a number from all date and time giving priority to Year>Month>Day>Hour>Minute>Second (Example: "01.02.2015 - 18:30:25" = 20150201183025) and then for every line that the program reads it reads also the previous(starting from the second line).
My sorting algorithm is:
Dim temp As String = ""
For i As Integer = 1 To Lines1.length
If fNumber >= sNumber Then
temp = Lines1(i - 1)
Lines1(i - 1) = Lines1(i)
Lines1(i) = temp
End If
Next i
Lines1() is the array of strings that I want the program to check
fNumber is the Number from the Lines(i-1)
and sNumber is the Number from the Lines(i)
But my result is the exact same list with no changes.
Can anyone help?

Sortfunction.