How to check if element is last in list with VB.NET

1 Answer

0 votes
Imports System
Imports System.Linq
Imports System.Collections.Generic

Public Class Program
	Public Shared Sub Main()
        Dim list As List(Of String) = New List(Of String)() From {
			"vb.net",
            "c",
            "java",
            "python",
            "php"
        }
		
        Dim str As String = "php"
		
        Console.WriteLine(str = list.Last())
    End Sub
End Class





' run:
'
' True
'

 



answered Aug 13, 2023 by avibootz
...