For example, you can keep all entered texts in the instance of the
System.Collections.Generic.HashSet<string>
:
https://msdn.microsoft.com/en-us/library/bb359438%28v=vs.110%29.aspx[
^].
You need to check of the string is already in set and, if it is not, add a new one. This collection types provides
time complexity of O(1).
If you want to persist the set of string, you can save it in file and restore back on application start.
It could be as simple as plain text file (for strings without end-of-line characters) or some XML, something like that.
—SA