How to test data type in C# application ?

Reply Forum
Forum postidi @ 2009-01-29 10:14:57
ReplyReply to
Hi all

How we could test data type in C# application ? which is like, if variable a = string, variable b = int, then variable c = class (instantiate = new class)

How can I determine/test early process for a and b that a = string and b = int?

It's the sample like this : int count = 0
How can i check that count is = integer (data type) ?

Thank you, your response will be appreciate


Forum postWebmaster @ 2009-02-02 13:49:06
ReplyReply to
Use the "is" operator. For instance:

if(count is int) {  }











© net-tutorials.com 2006 - 2012

MailContact net-tutorials.com