For example, there is a Scala array val A = Array("please", "help", "me")
. How to choose a random element from this array?
import scala.util.Random val A = Array("please", "help", "me") Random.shuffle(A.toList).head
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With