using System.Collections.Generic;
namespace Common.Extensions
{
public static class StringToolsExtensions
{
///
/// Add a string to a list only if it doesnt already exist
///
public static void AddUnique(this IList self, string item)
{
if (!self.Contains(item))
self.Add(item);
}
public static void AddUniqueRange(this IList self, IList itemsToAdd)
{
foreach (var item in itemsToAdd)
{
if (!self.Contains(item))
self.Add(item);
}
}
}
}