BotGenerator/Generator/StringToolsExtensions.cs

17 lines
397 B
C#
Raw Normal View History

2021-08-13 16:23:16 +01:00
using System.Collections.Generic;
2021-08-12 16:52:06 +01:00
namespace Generator
{
public static class StringToolsExtensions
{
2021-08-13 16:23:16 +01:00
/// <summary>
/// Add a string to a list only if it doesnt already exist
/// </summary>
2021-08-12 16:52:06 +01:00
public static void AddUnique(this IList<string> self, string item)
{
if (!self.Contains(item))
self.Add(item);
}
}
}