Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,846 questions

51,767 answers

573 users

How get key of highest key of a dictionary in VB.NET

2 Answers

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

Public Class Program
	Public Shared Sub Main()
		Dim dict = New Dictionary(Of String, Integer)() From {
					{"c#", 2},
					{"c++", 5},
					{"vb.net", 9},
					{"java", 7},
					{"c", 1},
					{"rust", 3}
				}


        Console.WriteLine(dict.Keys.Max())
    End Sub
End Class





' run:
'
' vb.net
'

 



answered Aug 11, 2023 by avibootz
0 votes
Imports System
Imports System.Linq
Imports System.Collections.Generic

Public Class Program
	Public Shared Sub Main()
		Dim dict = New Dictionary(Of Integer, String)() From {
					{2, "c#"},
					{5, "c++"},
					{9, "vb.net"},
					{7, "java"},
					{1, "c"},
					{3, "rust"}
				}


        Console.WriteLine(dict.Keys.Max())
    End Sub
End Class





' run:
'
' 9
'

 



answered Aug 11, 2023 by avibootz

Related questions

2 answers 151 views
5 answers 189 views
2 answers 95 views
1 answer 160 views
1 answer 98 views
1 answer 167 views
167 views asked Sep 26, 2018 by avibootz
...