Answers for "check if float is in range c#'"

C#
2

c# check if is float

public bool IsFloatOrInt(string value) {
  int intValue;
  float floatValue;
  return Int32.TryParse(value, out intValue) || float.TryParse(value, out floatValue);
}
Posted by: Guest on May-04-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

C# Answers by Framework

Browse Popular Code Answers by Language