I need to check if an int variable is a string.
These words won't make sense, but this might
int gn = int.Parse(textBox1.Text);
I need to see if the user has entered a string into the textbox rather than an int. Here are my (pitiful) attempts.
if (gn == string)
{
}
if (gn == String)
{
}
if (gn != string)
{
}
if (gn != String)
{
}
/*And I have even tried to use an if checking if the textbox had any letter
* of the alphabet in it; would have worked except if you used two letters.
*/
Thanks in advance, if anyone helps.
~Seth

New Topic/Question
Reply



MultiQuote




|