string[] myTargetArray=myClassList.ConvertAll<string>(xi=>xi.objStr).ToArray();
Here, myClassList is a List, and for some reason, the items in the List might be null.
How to achieve this using lambda expression: when the object is not null, return the objStr, if it's null, return an empty string "" ?
this should do it
When converting lists of Classes, an example of a
First
list type into a list ofSecond
type: