Method MakeUnique
MakeUnique(string, ICollection<string>)
Makes a name unique within a set of names already taken, by appending a number.
public static string MakeUnique(string name, ICollection<string> taken)
Parameters
namestringA name IsValid(string?) accepts.
takenICollection<string>The names already used. Compared ordinally, ignoring case, as Excel does.
Returns
- string
A legal name not in
taken.
Remarks
The suffix eats into the 31-character budget rather than overflowing it, which is why the base name is truncated before the number is appended.