Search snippets
Browse Code Answers
FAQ
Usage docs
Log In
Sign Up
Home
C#
c# count number of occurrences in string
Stephen M. Webb
Programming language:
C#
2021-04-28 08:10:00
0
Q:
c# count number of occurrences in string
Irhala
Code:
C#
2021-04-01 05:26:06
char myChar = 'x'; string myString = "xyz"; int count = myString.Count(s => s == myChar);
5
Tags
number
string
count
Related
how to count letters in c#
c# count items in listbox
get last character of string c#
find character from string c# count
c# get last two characters of string
last two characters of string c#
count number of enum values C#
count the number of notes in a given amount c#
c# count element in an array
how to remove last 3 characters from string in c#
New to Communities?
Join the community