Created
August 6, 2022 11:06
-
-
Save markcastle/060bb65d39d6b8fe77280e8ce532cee7 to your computer and use it in GitHub Desktop.
Simple check if a string contains a number in C# using LINQ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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