How to check the given input is string or integer?
Ex
if i'm giving my input as "vinoth".
i want my output like this
"It is a string".
if i'm giving my input as 123.
i want my output like this
"It is a integer".
How to check the given input is string or integer?
Ex
if i'm giving my input as "vinoth".
i want my output like this
"It is a string".
if i'm giving my input as 123.
i want my output like this
"It is a integer".
string st = "your string";
int number = 0;
bool result = int.TryParse(st , out number );
if result
is true then it is number else string.
You can do same for different numeric types also.