Jinja template for characters in a string

how would someone detect how many times a specific character exists within a string?

I assume you mean jinja, not json.

But in case there is nothing better then counting the length then removing the character and subtracting that is the count.

{% set str = "abcabc" %}
{{ (str | length) - (str | replace("a","") | length)}}
            6     -                             4        =  2