Charcount
From NEC Retro
Revision as of 18:17, 16 May 2023 by SorachiJirachi (talk | contribs) (Created page with "<includeonly>{{#vardefine:charcountresult|0}}{{#loop: subchar |0 |{{#len:{{{1}}}}} |{{#ifeq: {{#sub:{{{1}}}|{{#var:subchar}}|{{#len:{{{2}}}}}}} | {{{2}}} | {{incvar|charcountr...")
Revision as of 18:17, 16 May 2023 by SorachiJirachi (talk | contribs) (Created page with "<includeonly>{{#vardefine:charcountresult|0}}{{#loop: subchar |0 |{{#len:{{{1}}}}} |{{#ifeq: {{#sub:{{{1}}}|{{#var:subchar}}|{{#len:{{{2}}}}}}} | {{{2}}} | {{incvar|charcountr...")
This template counts the instances of a specified character (or another string) in a string. Note that it is case-sensitive.
Usage
{{charcount|She sells sea shells.|e}}
returns:
4