As others have said, it depends on how you insert the lines into your list. A couple of examples should help.
, , 1000 , . , "" 1000 :
hello
hello
hello
...
List<string> , 1000 . :
var myList = new List<string>();
var reader = new StreamReader("filename");
string s;
while ((s = reader.ReadLine()) != null)
{
myList.Add(s);
}
, , , - , . . , , .
var KeyLookup = new Dictionary<string, string>();
string AddString(string key)
{
string value;
if (!KeyLookup.TryGetValue(key, out value))
{
value = key;
KeyLookup.Add(key, value);
}
return value;
}
, :
while ((s = reader.ReadLine()) != null)
{
myList.Add(AddString(s));
}
"hello".
- . , , , , .
, , , , .