Count repetitions of characters in a string

We want a block that counts the repeated letters in a text box and returns the number of repetitions of each letter

You do not need an extension for this, use lists and list functions to do this. This work has already been demonstrated on the community somewhere...

1 Like

Where

most of the responses were incomplete, because the questions were about homework assignments, which this probably is as well ? here is one of my answers:

Use the text manipulation blocks to get the length of the sentece.
Use the split by block to convert all the characters to a list then compare each character with an alphabet list and do some counting.

2 Likes

Do you want to count for a specific repeated char from a string?

You could loop through the character (text segment in a loop by index number, or for each item in split at empty string), and add 1 to the count (initially 0) of each letter in a dictionary. (key = letter, value = count for that letter.)

Yes how

Are you a student? Is this a homework task?
Taifun

Yes

Yes .

I want images

I dropped the Project on my way to my PC, so the blocks fell apart.
Sorry!


letter_count.aia (2.1 KB)

2 Likes

Minus the blocks