Count Occurrences of a Character in a String using LINQ

try out the below code!

Dim
testString As String = "this is for testing the linq query."                       
Dim count As Integer = (From s In testString.ToCharArray Where s = "i" Select s).Count
thanks





-Shinu



Ebook Download
View all
Learn
View all