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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T08:42:46+00:00 2026-06-10T08:42:46+00:00

Hi i have two string builders s1 and s2. I am assigning orders to

  • 0

Hi i have two string builders s1 and s2. I am assigning orders to that stringbuilder using comma separator. I want to compare two string builders. I want to know that all the orders in s1 are in s2 as well. If not i want know which order is missing in s2. How to achieve that?

if (!IsPostBack)
{
    int reccount = dsResult.Tables[0].Rows.Count;
    for (int count = 0; count < reccount;count++)
    {
        HashSet<string> arrayOrdId = new HashSet<string>();
        arrayOrdId.Add(dsResult.Tables[0].Rows[count][1].ToString());
        // arrayOrdId[count] = dsResult.Tables[0].Rows[count][1].ToString();
    }
}
  • 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-10T08:42:49+00:00Added an answer on June 10, 2026 at 8:42 am

    I would suggest not using StringBuilder at all for this – instead, create two List<string> or possibly HashSet<string> to build up the order IDs, then compare those. If you need to create a string representation for other reasons, do that separately. (I’m assuming your order IDs are strings. If they’re not, use the appropriate type of collection instead.)

    It’s not clear whether the order matters, but if it doesn’t, HashSet<string> is what you should be using. You can find the differences easily enough:

    var missingFromX = y.Except(x);
    var missingFromY = x.Except(y);
    // Do whatever you want with those differences
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two directories that contain files. I want to combine all these files
I have two string variables which are both file paths. The code that worked
I have two Perl string variables containing date values. I want to check whether
I have two possible widths for a string i want to display in a
I have two static methods that I want to use for error handling. One
I have a StringBuilder object that needs to be trimmed (i.e. all whitespace chars
first of all, i like to say that i have read the other two
I have two String arrays a,b. String a [] = {one,two,three}; String b []
I have two strings String s1=426F62; String s2=457665; The strings are in hex representation.
I have declared two string buffers like, private StringBuffer buf = new StringBuffer(1024); private

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.