InterviewSolution
| 1. |
How Do You Determine Whether A String Represents A Numeric Value? |
|
Answer» To determine whether a STRING represents a numeric value use TryParse method as shown in the example below. If the string contains nonnumeric characters or the numeric value is too large or too small for the particular type you have SPECIFIED, TryParse returns false and sets the out parameter to zero. OTHERWISE, it returns true and sets the out parameter to the numeric value of the string. string str = "One"; To determine whether a String represents a numeric value use TryParse method as shown in the example below. If the string contains nonnumeric characters or the numeric value is too large or too small for the particular type you have specified, TryParse returns false and sets the out parameter to zero. Otherwise, it returns true and sets the out parameter to the numeric value of the string. string str = "One"; |
|