Skip to content

Instantly share code, notes, and snippets.

@markcastle
Created August 6, 2022 11:06
Show Gist options
  • Save markcastle/060bb65d39d6b8fe77280e8ce532cee7 to your computer and use it in GitHub Desktop.
Save markcastle/060bb65d39d6b8fe77280e8ce532cee7 to your computer and use it in GitHub Desktop.
Simple check if a string contains a number in C# using LINQ
using System.Linq;
namespace CaptiveReality.Utils
{
public class Common
{
public static bool IsNumeric(string value)
{
return value.All(char.IsNumber);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment