using System.Text;

namespace ExtensionMethods
{
	/// <summary>
	/// <para>Add extensions to <c><see cref="ulong"/></c></para>
	/// </summary>
	public static class ULongExtensions
	{
		/// <summary>
		/// <para>Concatenates a speceified separator <see cref="string"/> between each element of a specified <see cref="ulong"/> array, yielding a single concatenated string</para>
		/// </summary>
		/// <param name="array"></param>
		/// <param name="separator">A <see cref="string"/></param>
		/// <returns>The concatenated <see cref="string"/></returns>
		public static string Join(this ulong[] array, string separator)
		{
			StringBuilder concat = new StringBuilder();
			bool notFirst = false;
			foreach (ulong item in array)
			{
				if (notFirst)
					concat.Append(separator);
				else
					notFirst = true;
				concat.Append(item);
			}
			return concat.ToString();
		}
	}
}