Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1023459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:37:26+00:00 2026-05-16T11:37:26+00:00

I have an object, with ID and Name properties. I have a list of

  • 0

I have an object, with ID and Name properties.

I have a list of the objects, but I want to convert it to a list of strings containing the name of the object.
I’m guessing there’s some fancy Linq method that will put the name of the object into the list.

List<string> myObjectNames = myObjectList.?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:37:27+00:00Added an answer on May 16, 2026 at 11:37 am

    If you know it is specifically a List<T> and not another collection type then you can use List<T>.ConvertAll:

    Converts the elements in the current List<T> to another type, and returns a list containing the converted elements.

    Example:

    List<string> myObjectNames = myObjectList.ConvertAll(x => x.Name);
    

    If you just know that it is an enumerable type but not necessarily a list then you can use the LINQ extension methods Enumerable<T>.Select and Enumerable<T>.ToList:

    List<string> myObjectNames = myObjects.Select(x => x.Name).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an object Document with nested Properties (Name, Value) collection. Now I want
I have an object with the following properties GID ID Code Name Some of
I have a generic list of objects, for example: List<Photo> and want to convert
I have a list of custom objects: say Fruits with two string properties Name
I have an object AppDetail containing 2 string properties, a name, and a version
I want to implement custom JSP list tag, but have problem with accessing properties
I have a list of objects, each with 2 relevant properties: ID and Name.
If I have an object, with properties like name, phone_number, etc...how can I access
i have a list with objects. The object has a property 'Sales' which is
I have a Person class with two properties: name and address . I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.