Skip to content

Instantly share code, notes, and snippets.

@marcioalthmann
Created May 16, 2012 00:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcioalthmann/2706392 to your computer and use it in GitHub Desktop.
Save marcioalthmann/2706392 to your computer and use it in GitHub Desktop.
Usando String.Intern
var nomes = new List<string>();
for (int i = 0; i < 1000; i++)
{
nomes.Add("Althmann");
}
Console.WriteLine("Agora usando String.Intern");
Console.WriteLine("Digite o mesmo texto várias vezes.");
while (true)
{
nomes.Add(String.Intern(Console.ReadLine()));
}
Console.Read();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment