Is there a .Net function that does that. I guess if there isn't i have to make my own method.
The thing is i have a function. It accepts integers. If you pass a 0 integer or a null value it still works. Problem is that the value of an empty textbox is a String.Empty value.
I don't want to use if's. I mean it could but its much nicer if i can just call my function like this
MyFunction(txtTextbox.Text)
But it won't work because it can't convert the string.empty to a integer.
MyFunctionthe same as the function you refer to in the second paragraph? It doesn't seem like it can be since you clearly intended to pass astringto it, not "a 0 integer or null". In case you're not aware, you can't just pass astringto a function acceptingintorint?.