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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T21:42:43+00:00 2026-05-16T21:42:43+00:00

I have a small struct and I have to compare the values to find

  • 0

I have a small struct and I have to compare the values to find which ones have the same FreeFlow text, and then grab that struct ENumber.

   public struct Holder
    {
        public string FreeFlow;
        public int ENumber;
    }

and here is how I add them

foreach(Class1.TextElement re in Class1._TextElements)
            {
                //create struct with all details will be good for later
                Holder ph = new Holder();
                ph.FreeFlow = re.FreeFlow;
                ph.ENumber = re.ENumber;
                lstHolder.Add(ph);
            }

      foreach(Class1.TextElement2 re in Class1._TextElements2)
            {
                //create struct with all details will be good for later
                Holder phi = new Holder();
                phi.FreeFlow = re.FreeFlow;
                phi.ENumber = re.ENumber;
                lstHolder2.Add(phi);
            }

I can do a comparing using a foreach within a foreach, but I think this will not be the most effective way. Any help?

EDIT: I am trying to determine if freeflow text is exactly the same as the other struct freeflow text

  • 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-16T21:42:44+00:00Added an answer on May 16, 2026 at 9:42 pm

    I have to compare the values to find
    which ones have the same FreeFlow
    text, and then grab that struct
    ENumber.

    If you can use LINQ you can join on the items with the same FreeFlow text then select the ENumber values of both items:

    var query = from x in Class1._TextElements
                join y in Class1._TextElements2 on x.FreeFlow equals y.FreeFlow
                select new { xId = x.ENumber, yId = y.ENumber };
    
    foreach (var item in query)
    {
        Console.WriteLine("{0} : {1}", item.xId, item.yId);
    }
    

    EDIT: my understanding is the FreeFlow text is the common member and that ENumber is probably different, otherwise it would make sense to determine equivalence based on that. If that is the case the join query above should be what you need.

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

Sidebar

Related Questions

I have a small 3D vector class in C# 3.0 based on struct that
I have small page which has label, DropDownList and a submit button. <div> <asp:label
I have a small JS function that does Ajax for me and another like
I have a small utility that I use to download an MP3 file from
I have a small VB.NET application that I'm working on using the full version
I have a small application I am working on that at one point needs
I have a small array of structs, each struct has three fields, all strings.
I have a small XML file: <wddxPacket version='1.0'> <header/> <data> <struct type='coldfusion.runtime.ArgumentCollection'> <var name='HEADLINE'>
I have a small function that tries to print the fragment offset of an
I have a small- to medium-size project that I am doing for my software

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.