+ 4

How do you chose a random string in an array in C#?

I know this can be done because I've done it in Lua. It was a random tag and a hashtag before the array name. I just don't know how to do it in C#.

30th May 2018, 12:05 PM
Archie
Archie - avatar
3 Antworten
+ 2
lets say your array A has n members. just generate a random integer r between 0 and n using System.Random and then A[r] is your random element
30th May 2018, 1:12 PM
Max
Max - avatar
0
The string context Number of integer that randomlu taken by the value
14th Jun 2018, 7:42 AM
Kesav KUMAR
Kesav KUMAR - avatar
0
no
14th Jun 2018, 10:04 AM
emma