VB.Net – Count substring occurrences in a string

The simplest way

Dim text = ".Maui is awesome"
Dim count = text.Split("a").Length -1 

Leave a Comment

Your email address will not be published. Required fields are marked *