Created
January 8, 2014 17:15
-
-
Save ajpinedam/8320480 to your computer and use it in GitHub Desktop.
Using replace on a Linq Lambda Expression..
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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