A problem that has cost me a good few hours in Visual Studio when programming a WPF application with C#

A problem that has cost me a good few hours in Visual Studio when programming a WPF application with C#
When programming in Visual Studio with C# (C-Shap), it can happen that you have to determine how often a substring