Object Reference Not Set Error


I have a String variable (AddrestPostalCode) which contains a value say : POSTCODE UB1 1PY.
I wanted to split this value further to perform a validation. So i am using
AddrestPostalCode.ToString.Trim.Split(Environment.NewLine.ToArray,StringSplitOptions.RemoveEmptyEntries) for this i am getting Object Reference not set to an instance of an object error.

Object reference error will appear when the variable doesn’t hold a value and not initialized.
You can check if the varaible AddrestPostalCode has the value before applying split.

Thanks Udhay. While integration value is missing now its working fine, thanks again