Skip to content

Instantly share code, notes, and snippets.

@uqmessias
Created May 17, 2016 18:12
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save uqmessias/6a3e0daa0e058b4c959144ecda2d87b2 to your computer and use it in GitHub Desktop.
private IEnumerable<string> nomes = new List<string>(){ "Uilque", "Lucas", "Luiz", "João", "Pedro", "Antônio" };
public IEnumerable<string> NomesGrandesEmCaixaAltaOrdenados1()
{
var nomesGrandesEmCaixaAlta = from n in nomes.Where(n => n.Length > 5)
orderby n
select n.ToUpper();
return nomesGrandesEmCaixaAlta;
}
public IEnumerable<string> NomesGrandesEmCaixaAltaOrdenados2()
{
var nomesGrandesEmCaixaAlta = (from n in nomes.Where(n => n.Length > 5)
select n.ToUpper()
).OrderBy(n => n);
return nomesGrandesEmCaixaAlta;
}
public IEnumerable<string> NomesGrandesEmCaixaAltaOrdenados3()
{
var nomesGrandesEmCaixaAlta = (from n in nomes
where n.Length > 5
select n
).OrderBy(n => n)
.Select(n => n.ToUpper());
return nomesGrandesEmCaixaAlta;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment