How to check if string contains a string in string array
- by Abu Hamzah
edit: the order might change as you can see in the below example, both string have same name but different order....
How would you go after checking to see if the both string array match?
the below code returns true but in a reality its should return false since I have extra string array in the _check
what i am trying to achieve is to check to see if both string array have same number of strings.
string _exists = "Adults,Men,Women,Boys";
string _check = "Men,Women,Boys,Adults,fail";
if (_exists.All(s => _check.Contains(s))) //tried Equal
{
return true;
}
else
{
return false;
}