[AccessD] Count the occurrences of each character in a string

Paul Hartland paul.hartland at googlemail.com
Mon Sep 5 04:04:40 CDT 2022

Off the top of my head I would use something like a two dimensional array,
then loop through the word letter by letter, if already in the array add 1
if not add it to the array with 1 as the value, so yourarray(0,0) = 'M' and
yourarray(0,1) = 1

Etc etc then do what you like with the array.

Very busy at work at moment but if you need an example let me know and will
knock one up in about 9 hours time after work



On Mon, 5 Sep 2022, 09:43 Arthur Fuller, <fuller.artful at gmail.com> wrote:

> I'm trying to figure out the best way to count the occurrences of each
> character in a string.
> Sample string: "mississipi"
> I should get back an array looking like this:
> Character Count
> m 1
> i 4
> s 4
> p 1
> Any suggestions?
> --
> Arthur
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com

More information about the AccessD mailing list