string[] B = C.OfType<object>().Where(o =>o != null).Select(o => o.ToString()).ToArray();
I try to Convert Array C to string[]
but, Array C have a lot of null and I hope null change to " "
What Should I do?
string[] B = C.OfType<object>().Where(o =>o != null).Select(o => o.ToString()).ToArray();
I try to Convert Array C to string[]
but, Array C have a lot of null and I hope null change to " "
What Should I do?
You don't need OfType<object>(), simply call string.Concat:
var s = string.Concat(C.ToArray());
If you look at documentation:
The method concatenates each object in args by calling the parameterless ToString method of that object; it does not add any delimiters. String.Empty is used in place of any null object in the array.'