Dim testString As String = "this is for testing the linq query."
VB.NET
Dim count As Integer = (From s In testString.ToCharArray Where s = "i" Select s).Count
thanks
-Shinusimple code to find the Occurrences of a Character in a String using LINQ
Dim count As Integer = (From s In testString.ToCharArray Where s = "i" Select s).Count
thanks
-Shinu
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegisterMembers onlyFeatured eBookClaude for AI-Native BuildersDownload nowWrite a blog post and earn +250 SHARP when it is approved.
Write a blog
Join the conversation! Your thoughts help the community grow.