I am new to C#, I want to write a function to iterate over properties of an object and set all null strings to \"\". I have heard that it is possible using something called \"Re
foreach(PropertyInfo pi in myobject.GetType().GetProperties(BindingFlags.Public)) { if (pi.GetValue(myobject)==null) { // do something } }