Answers for "how to check if index is in range c#"

C#
0

how to check if list index is out of range in c#

if(index >= 0 && index < array.Length)
{
    //it exists
}
Posted by: Guest on June-21-2021
-1

c# if int is in range

int x = 30;

if (Enumerable.Range(1,100).Contains(x))
    //true

if (1 <= x && x <= 100)
    //true
Posted by: Guest on September-14-2021

Code answers related to "how to check if index is in range c#"

C# Answers by Framework

Browse Popular Code Answers by Language