VB.NET- Random String from a set

A Quick Code Snippet in VB.Net/ ASP.Net- Picks a random string from the set.

Dim RandomNumber As Integer = RandomClass.Next(0, 3)
Dim RandomString As String = {"red", "green", "yellow"}(RandomNumber)

Advert:

Leave a Reply

Your email address will not be published. Required fields are marked *