Skip to content

Instantly share code, notes, and snippets.

@ajpinedam
Created January 8, 2014 17:15
Show Gist options
  • Save ajpinedam/8320480 to your computer and use it in GitHub Desktop.
Save ajpinedam/8320480 to your computer and use it in GitHub Desktop.
Using replace on a Linq Lambda Expression..
void Main()
{
var indi = new List<Indi>();
var cedulaSearch = "02317270340";
indi.Add(new Indi{Name="Joseph", Cedula="013-1487034-8"});
indi.Add(new Indi{Name="Milton", Cedula="023-1727034-0"});
var result = indi.FirstOrDefault(u => u.Cedula.Replace("-","") == cedulaSearch);
}
// Define other methods and classes here
public class Indi
{
public string Name {get; set;}
public string Cedula {get; set;}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment