How select a name contains the second letter is "s" using LINQ? -


enter image description here

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

Popular posts from this blog

cookies - Yii2 Advanced - Share session between frontend and mainsite (duplicate of frontend for www) -

angular - password and confirm password field validation angular2 reactive forms -

php - Permission denied. Laravel linux server -