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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:32:13+00:00 2026-05-23T03:32:13+00:00

I have a bool array that looks like this bool[] responses = new bool[]

  • 0

I have a bool array that looks like this

bool[] responses = new bool[] {true, false, true};

And two classes that look like this:

public class Person {
  public IList<PersonDetail> PersonDetails
}

public class PersonDetail {
  public bool   Correct { get; set; }
}

PersonDetails
 >> PersonDetail[0].correct = true
 >> PersonDetail[1].correct = true
 >> PersonDetail[2].correct = false

Is there a simple way I can compare these to see if the true/false are equal for each?
I was trying to use the c# .SequenceEqual but I don’t know how to get the data from
the PersonDetail class into a sequence xxx that I can use to compare with responses.

Here’s what I have so far:

var equal = responses.Select(bool.Parse).SequenceEqual( xxx );

What I need to do is to compare the following:

responses[0] == PersonDetail[0].correct and
responses[1] == PersonDetail[1].correct and
responses[2] == PersonDetail[2].correct 

So what’s true in responses[x] should match true in PersonDetail[x] and what’s false in responses[x] should match false in PersonDetail[x]

  • 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-23T03:32:14+00:00Added an answer on May 23, 2026 at 3:32 am

    Not 100% sure of your code, but maybe:

    var equal = responses.SequenceEqual(Person.PersonDetails.Select(PD => PD.correct);

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

Sidebar

Related Questions

I have an array of type string that looks like this: test1|True,test2|False,test3|False,test4|True . This
Lets say we have this code: bool KeepGoing = true; DataInThread = new Thread(new
I have this function: public bool IsValidProduct(int productTypeId) { bool isValid = false; if
I have method for converting array of Booleans to integer. It looks like this
I have a method that starts like this: public static UnboundTag ResolveTag(Type bindingType, string
A basic solution would look like this: bool sortTest(int[] numbers, int target) { Array.Sort(numbers);
I'm using symfony 1.4.8 and I have some code that basically looks like this
I have this method: public bool CanExecute() And after 70 commits, I added an
We have this field in our database indicating a true/false flag for each day
I'm still playing around with xml. Now I have a file that looks like

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.