Counting the occurrence of a character in a string

Hi everyone!
I hope I'm writing in the right section. I also searched a bit on the forum and I couldn't find any topic on this subject...

I have a string with artist names separated by commas, and I need to know how many artist are in that string.
Is it possible, for example, to know how many times regexp replaced something?

Any other way I?

Thanks a lot,

This should give you the number of artists:

no comma = one artist
one comma = two artists
two commas = three artists

Thank you very much! This is a very interesting solution :slight_smile:

The following proposal could also be of interest.


no artist --> 0
no comma --> one artist --> 1
one comma --> two artists --> 2
two commas --> three artists--> 3