Linked Questions

0 votes
2 answers
5k views

I've got a List properties that must contain both pivot1 and pivot2. How can I make Contains work with BOTH values? List<string> properties = line.Split('|').ToList(); string pivot1 = "value1";...
ryokan's user avatar
  • 115
-2 votes
4 answers
258 views

If I have the following... List<string> listA = new List<string>(); listA.Add("a"); listA.Add("b"); listA.Add("c"); listA.Add("d"); List<string> listB = new List<string>(); ...
Howard's user avatar
  • 3,788
2 votes
3 answers
968 views

Below is my class: public class Test { public string Name {get;set;} public int ID {get;set;} public IList<string> Tags {get;set;} Public Test() { Tags = new List&...
mcp developer's user avatar
1 vote
1 answer
172 views

I have 2 int arrays, arr1, and arr2 eg, what is the most efficient way to verify that the arr1 contains All items that arr2 contains. Preferentially returning bool. eg. arr1 = [1,2,3,4] arr2 = [1,2,...
우두머리's user avatar
0 votes
3 answers
172 views

I have this set: List<short> delegatingUserRoles = await (from urols in _dbContext.UsersRoles join u in _dbContext.Users on urols.UserId ...
user18363545's user avatar
170 votes
10 answers
68k views

Any idea on how to check whether that list is a subset of another? Specifically, I have List<double> t1 = new List<double> { 1, 3, 5 }; List<double> t2 = new List<double> { 1,...
Graviton's user avatar
  • 83.2k
3 votes
9 answers
2k views

Is it possible to Know or check if all elements in List1 is a part of List2 ? Example if I have List1 = { 1,2,3,4 } List2 = { 1,2,3,5,6,4 } I want to get True if all elements in List 1 are in List 2 ...
kartal's user avatar
  • 18.2k
17 votes
6 answers
6k views

I'm working on a Greatest Common Factor and Least Common Multiple assignment and I have to list the common factors. Intersection() won't work because that removes duplicates. Contains() won't work ...
DuckReconMajor's user avatar
11 votes
4 answers
8k views

The best way that I can explain what I'm trying to do is by giving an example: I have a string StackOverflow in my database and when a user types OAW I would like to return that string and any other ...
HiTech's user avatar
  • 1,013
6 votes
4 answers
9k views

How can I determine if List A contains all of the elements from List B in the same order? List A can have additional elements that List B does not have, but must contain all elements of List B in ...
Ricketts's user avatar
  • 5,223
3 votes
1 answer
3k views

I got roped into some old code, that uses loose (untyped) datasets all over the place. I'm trying to write a helper method to find the DataTable.Name using the names of some columns.....(because the ...
granadaCoder's user avatar
  • 28.2k
-2 votes
2 answers
240 views

Is there any elegant way in c# to check whether a List<T> contains a sub-List<T> similar to string.Contains(string)? Let's say e.g. I want to test for example whether List A is contained ...
derHugo's user avatar
  • 92.6k
1 vote
6 answers
256 views

I am looking at an algorithm that does the following I have two List<String>, say List<String> A == {"20", "32A", "50K", "50F", "50D", "70", "72"} List<String> B == {"20", "32A", "...
Jefferson Bien-Aime's user avatar
0 votes
3 answers
315 views

Is it possible to compare two listboxes and their respected selected values? Basically I want to check if listbox A's selected values == listbox B's selected values. I tried this code, but it didn't ...
Zach's user avatar
  • 143
1 vote
1 answer
374 views

It might sound like this answer was asked before, but it is not the same. I was looking for a way to check if a List "A" contains all the elements from a List "B" and i got the answer from this ...
enbermudas's user avatar
  • 1,625

15 30 50 per page