Find occurences of each character in the string

How to find the occurences of each character in the given string-“aadfggggtryionnb”?

refer to this
testnew.xaml (8.7 KB)

create dictionary and loop over each character in string,
for each character,
dict(letter) = str.Where(Function(c) c = letter).Count


1 Like

are there any other methods?

Hi @ydash999 ,

Check the below Method :


you can assign this value to a Dictionary of String,Integer variable.


thankss bro

thanksss bro

Hi @ydash999,

count character
Above link is a more simplified solution. Remember to import System.Text.RegularExpressions first
import regex

how can i find occurence of each character with this?

You assign below to a string variable.
“item” will be your string variable


i dont have to find the total count, but count of occurences of each character

I just edited the “Total” to “a”. This is where you put the character you want to find

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.