Do you have an example of the data or even the code you're tried?
thines01
Postaholic
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
Technique 1:
Imports System.Collections.Generic
Imports System.Linq
Module Module1
Sub Main()
Dim lst_strNums As New List(Of String) From _
{"566030300001", "566030300002", "566030300003", "566030300004"}
Dim strMax As String = lst_strNums.Select(Function(s) s.Substring(7, 5)).Max()
Console.WriteLine(strMax)
End Sub
End Module
thines01
Postaholic
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402
Technique1 + Technique2:
Imports System.Collections.Generic
Imports System.Linq
Module Module1
Function Max1(ByVal lst_str As List(Of String)) As String
Return lst_str.Select(Function(s) s.Substring(7, 5)).Max()
End Function
Function Max2(ByVal lst_str As List(Of String)) As String
Return lst_str.Select(Function(s) s).Max()
End Function
Sub Main()
Dim lst_strNums As New List(Of String) From _
{"566030300001", "566030300002", "566030300003", "566030300004"}
Console.WriteLine(Integer.Parse(Max1(lst_strNums)))
Console.WriteLine(Integer.Parse(Max2(lst_strNums).Substring(7, 5)))
End Sub
End Module
thines01
Postaholic
2,424 posts since Oct 2009
Reputation Points: 445
Solved Threads: 402