This commit is contained in:
2020-05-15 23:24:27 +00:00
parent 6d0fc8762f
commit 443c95b36c

View File

@@ -12,15 +12,15 @@ namespace AyaNova.Biz
{
//clean up tags from client submission
//remove dupes, substitute dashes for spaces, lowercase and shorten if exceed 255 chars
//and sorts before returning to ensure consistent ordering
public static List<string> NormalizeTags(List<string> inTags)
{
if (inTags == null || inTags.Count == 0) return inTags;
List<string> outTags = new List<string>();
foreach (var tag in inTags)
{
outTags.Add(NormalizeTag(tag));
}
outTags.Sort();
return outTags.Distinct().ToList();
}