Well, assuming order is not important, you may use split and then perform a check on all the components of the
s1
array, namely:
string s1 = "I1,I2";
string s2 = "I1,I3,I2";
string[] a1 = s1.Split(new char[] { ',' });
string[] a2 = s2.Split(new char[] { ',' });
int matches = 0;
foreach (string i1 in a1)
foreach (string i2 in a2)
{
if (i1 == i2)
{
matches++;
break;
}
}
if (matches == a1.Count())
{
Console.WriteLine("s1 items are in s2");
}
else
{
Console.WriteLine("s1 items are NOT in s2");
}