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

  • Home
  • SEARCH
  • 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 8793451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:07:28+00:00 2026-06-13T23:07:28+00:00

This has to be an easy question, but I cannot figure out how to

  • 0

This has to be an easy question, but I cannot figure out how to create a list of names separated by commas without having a trailing comma at the end.

So here is my code…

    For Each u In users
        userList.Append(u.FirstName)
        userList.Append(" ")
        userList.Append(u.LastName)
        userList.Append(", ")
    Next

This creates a list, but it always looks likes this:

James Smith, Chris Williams, Zoey Babcock,

How do I get generate a list without an extra comma at the end?

Thanks

Here is the working code thanks to all the help:

    Dim fullNames = (users.Select(Function(u) u.FirstName + " " + u.LastName))
    Dim userList As String = String.Join(", ", fullNames)
  • 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-06-13T23:07:28+00:00Added an answer on June 13, 2026 at 11:07 pm

    You can use LINQ to project each user into a collection of full names, then use String.Join() to join them using a separator of your choice.

    List(Of String) fullNames = From u _
                                In users _
                                Select (u.FirstName + " " + u.LastName)
    String userList = String.Join(", ", fullNames)
    

    You can express the LINQ query like this as well. It is identical to the above:

    List(Of String) fullNames = _
                    users.Select(Function(u) u.FirstName + " " + u.LastName)
    String userList = String.Join(", ", fullNames)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This has got to be an easy question but I'm not finding anything out
This may seem an easy question, but not to me, also a search has
I am sure this is an easy question, but one that has escaped me
I know this question has posted several time. But I cannot solve my issue
I hope this is a quite easy question but I couldn't understand why is
I know this is probably an easy question but after reviewing the documentation for
This is probably an easy question but since I'm new with Symfony it's still
I'm sure this has an easy answer, but I don't know it. so I
This is probably an easy question, but I'm a newbie, so I'm drawing a
This has been asked before (question no. 308581) , but that particular question and

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.