public static IEnumerable<string> ParseTags(string tags)
{
List<string> tagList = new List<string>();
char delimiter = ',';
if (!string.IsNullOrEmpty(tags))
{
// For the legacy tag seperator format
if (tags.IndexOf(";") != -1)
delimiter = ';';
if (tags.IndexOf(delimiter) != -1)
{
string[] parts = tags.Split(delimiter);
foreach (string item in parts)
{
if (item != "," && !string.IsNullOrWhiteSpace(item))
tagList.Add(item.Trim());
}
}
else
{
tagList.Add(tags.TrimEnd());
}
}
return tagList;
}