Question: I need to check if the first element of a string is positive integer in C#.
is there a smart Way to do this?
Fx

```
string str = "2001";
if (str.First() == isANumber) {
...                                
}

```

Answer: 
You can use [char.IsDigit](http://msdn.microsoft.com/en-us/library/7y5kahff.aspx) method to check if the first character is a digit or not. 

```
if(char.IsDigit(str[0]))
    Console.WriteLine("Starting character is positive digit");
else
    Console.WriteLine("Starting character is not a digit");

```

Its better if you can check the length of the string before accessing its index `0`
hello u can use this...

```
string something = "some string";
bool isDigit = char.IsDigit(something[0]);

```