Answers for "find the number of occurrences of a string in a string using c#"

C#
11

c# count number of occurrences in string

char myChar = 'x';
string myString = "xyz";

int count = myString.Count(s => s == myChar);
Posted by: Guest on February-24-2020

Code answers related to "find the number of occurrences of a string in a string using c#"

C# Answers by Framework

Browse Popular Code Answers by Language