ActiottHeffob
New Member
I am moving from VBScript to C# and am having trouble finding a way to check for an empty value. I want to do something like:<BR><BR>String someString = Request.Params["someString"];<BR>if (someString.Empty) {<BR>//do stuff<BR>}<BR><BR>But that gives me an error. Is there another way to check for this? By the way, how would I check for IsNumeric()?<BR>if (someString.Length == 0) {<BR> // do stuff<BR>}<BR><BR>AFAIK, there is no isNumeric type method of the string class, and there is no inherent one in C#. You could, of course, easily write your own using regular expressions.Thanks Scott,<BR>But the way you mentioned doesn't work, because of what Request.Params returns. I get this error:<BR>System.NullReferenceException: Object reference not set to an instance of an object.<BR><BR>So instead I am doing:<BR>String someString = "";<BR>someString += Requst.Params["someValue"];<BR>if (someString.Length != 0) {<BR>// do stuff<BR>}<BR>