RecipeDan
asked on
Null Array
I have a value that I am splitting into an array. When the value is null, it gives me an error message. How can I prevent the error message when the value is null.
string PhoneNum = reader["PhoneNumber"].ToString();
string[] strArr = PhoneNum.Split('-');
PersonPhoneNumber1.Value = strArr[0];
PersonPhoneNumber2.Value = strArr[1];
PersonPhoneNumber3.Value = strArr[2];
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER