how to arrange sort order in strings
[possible duplicate] How to customize sort order of strings
regarding the same question which was stated to order
bufallo@2000
lice@20
cell@1
rat@150
cow@10000
into
cow@10000
bufallo@2000
rat@150
lice@20
cell@1
Now,my question is suppose if I were to neglect the numeric part less than
100 that is to make it into
cow@10000
bufallo@2000
rat@150
removing the other two can this be made possible?
I have tried
Dim number As Int32 = Int32.MinValue
Dim orderedLines = From line In TextBox1.Lines
Let parts = line.Split("@"c)
Let numericPart = parts.Last()
Let success = Int32.TryParse(numericPart, number)
Select LineInfo = New With {line, number}
Order By LineInfo.number Descending
Select LineInfo.line
' if you want to reassign it to the TextBox:
TextBox1.Lines = orderedLines.ToArray()
but I do not know how I can customise the numeric part less than 100
thereby deleting the rest.
No comments:
Post a Comment