I have this method:
public List<string> AdvMultiKeySearch(string key)
{
string[] listKeys = key.Split(',');
string[] ORsplit;
List<string> joinedDashKeys = new List<string>();
List<string> joinedSearchKeys = new List<string>();
for (int i = 0; i < listKeys.Length; i++)
{
ORsplit = listKeys[i].Split('|');
joinedDashKeys.Add(string.Join(",", ORsplit));
}
for (int i = 0; i < joinedDashKeys.Count; i++)
{
string[] split = joinedDashKeys[i].Split(',');
for (int j = 0; j < split.Length; j++)
{
joinedSearchKeys.Add(string.Join(",", split[i]));
}
}
return joinedDashKeys;
}
I am trying to create a method that receives a string Keyword that is composed of the words,comas, and '|' character. For example, user enters
glu|sal,1368|1199
And method should produce/return List of strings: "glu,1368", "glu,1199", "sal,1368", "sal,1199"
It's been more than two hours and I still can't figure out how to correctly implement it. Can someone help please?