I have the following class:
public class Fruit
{
public int FruitID { get; set; }
public string FruitTitle { get; set; }
public string FruitName { get; set; }
}
Now I want to get all FruitTitles within a string[]
.
I have an object List<Fruit>
string[] fruitTitles = fruits.Select(fruit => fruit.FruitTitle)
.ToArray();
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments