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 130753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:59:52+00:00 2026-05-11T05:59:52+00:00

In web app I am splitting strings and assigning to link names or to

  • 0

In web app I am splitting strings and assigning to link names or to collections of strings. Is there a significant performance benefit to using stringbuilder for a web application?

EDIT: 2 functions: splitting up a link into 5-10 strings. THen repackaging into another string. Also I append one string at a time to a link everytime the link is clicked.

  • 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. 2026-05-11T05:59:52+00:00Added an answer on May 11, 2026 at 5:59 am

    How many strings will you be concatenating? Do you know for sure how many there will be, or does it depend on how many records are in the database etc?

    See my article on this subject for more details and guidelines – but basically, being in a web app makes no difference to how expensive string concatenation is vs using a StringBuilder.

    EDIT: I’m afraid it’s still not entirely clear from the question exactly what you’re doing. If you’ve got a fixed set of strings to concatenate, and you can do it all in one go, then it’s faster and probably more readable to do it using concatenation. For instance:

    string faster = first + ' ' + second + ' ' + third + '; ' + fourth;  string slower = new StringBuilder().Append(first)                                    .Append(' ')                                    .Append(second)                                    .Append(' ')                                    .Append(third)                                    .Append('; ')                                    .Append(fourth)                                    .ToString(); 

    Another alternative is to use a format string of course. This may well be the slowest, but most readable:

     string readable = string.Format('{0} {1} {2}; {3}',                                  first, second, third, fourth); 

    The part of your question mentioning ‘adding a link each time’ suggests using a StringBuilder for that aspect though – anything which naturally leads to a loop is more efficient (for moderate to large numbers) using StringBuilder.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a web app using Ruby and Sinatra, and I'm splitting up
Our web app uses the Google CDN to link to the jQuery library and
I built my web application using asp.net mvc3. I need to add admin pages
WEB APP not native, no Objective-C This is so simple it hurts. <input type=date
Our web app uses SystemPropertyPlaceholder to load property files depending on the value of
My web app builds a batch request to the Facebook graph API. The batch
A web app I'm working on requires frequent parsing of diverse web resources (HTML,
My web App prepares out of a db for one or two minutes a
Our web app needs to be made PCI compliant, i.e. it must not store
My web app solution consists of 3 projects: Web App (ASP.NET MVC) Business Logic

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.