Delrosss Delrosss - 1 year ago 95 Question

How do i randomly select something from a table?

Dim lolthisisatable = {"1", "2", "3", "4", "5", "6", "7", "8", "9", "10"}
I'm trying to select a string randomly from this table "lolthisisatable"
like (insert code that selects a string randomly from that table)
string "2" was choosen randomly

how do i do that in Visual Basic 2010

Answer Source

Use this code lolthisisatable(New Random().Next(0, lolthisisatable.Length-1))

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download