Skip to content

Instantly share code, notes, and snippets.

@uqmessias
Created April 6, 2016 15:42
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 uqmessias/bf7cf26de2fe3aeb74dd157670d25012 to your computer and use it in GitHub Desktop.
Save uqmessias/bf7cf26de2fe3aeb74dd157670d25012 to your computer and use it in GitHub Desktop.
public int[] novoArrayComItensRepetidos(int itemARepetir, int totalItens)
{
return Enumerable.Repeat(itemARepetir, totalItens).ToArray();
}
public int[] novoArraySequencial(int ultimoValor)
{
return Enumerable.Range(1, ultimoValor).ToArray();
}
public int[] novoArraySequencialMultiploDe10(int totalItens)
{
return Enumerable.Range(1, totalItens).Select(n => n * 10).ToArray();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment