How to make this Random.Range shorter?

Whats the shortest way to put these codes? Just trying to shorten my scripts because I have a lot of these examples throughout my scripts. Is there a way to use no var? Thank you

var randomNumber = Random.Range(0,2);
if (randomNumber==0) {
//blah
}
else {
//bleh
}

and this?

var randomNumber = Random.Range(0,3);
if (randomNumber==0) {
//blah
}
else if (randomNumber==1) {
//bleh
}
else {
//bluh
}

Use C# instead and invest in a copy of Resharper, you’ll learn tons of ways to shorten your scripts and improve productivity.

You could do

switch (Random.Range(0,3)) {
 case 1:
      DoWhatever();
      break;
 case 2:
      DoSomethingElse();
      break;
}

There are lots of ways to do stuff.

Thanks will give it a try for sure!

Thanks this solves my question