Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# count number of occurrences in string

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

int count = myString.Count(s => s == myChar);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #count #number #occurrences #string
ADD COMMENT
Topic
Name
5+9 =