c# - Easier way of checking Int32.TryParse -
I'm looking at all these in a method in your code:
int num1 = 0; If (four. Aisdigit (Maistret [2]) & amp; Int 32. Tryprs (Maistr [2]. Tustring (), out of 1 points) == false) {valid = false; } So are they making sure that the third letter gives us a score?
It seems that doing so efficiently that you have code that is coded he knows myStr the structure of the string, sometimes a non-numerical symbols on the third place, which is why he third before having to pay for the conversion of the array of character strings Created this optimization to check the symbol.
Chances are, it's customizable time: although temporary throw-not far string free, this optimization will only be in situations when you do it a lot in very tight loop. In other words, you only do when it appears at the top of the output of your display profiler.
You can customize this check to avoid if :
integer number 1 = 0; Legal & amp; =! Char.IsDigit (myStr [2]) || Int32.TryParse (myStr [2] .tostring (), out num1);
Comments
Post a Comment