How select a name contains the second letter is "s" using LINQ? -
how select name database contains second letter "s" using linq ?
using lambda expressions:
var str = new string[] { "tsr", "mrg", "d" }; var result = str.where(s => s.length>1 && s[1] == 's');
the result variable contain "tsr" value, , checking word have @ least 2 characters otherwise exception thrown
Comments
Post a Comment