Template:Has char

The Template:Has_char checks in parameter 1 for the presence of the character in parameter 2, within the length lenstr=20. For each occurance, then {has_char} adds "+1" as a running count of the matching characters.
 * Usage: &rarr; +1
 * &rarr; +1+1+1
 * &rarr; +1
 * &rarr; 2

To evaluate the total count of matching characters, then the function " " can be used to calculate the expression, with "0" as the starting amount.

Performance considerations
Template {has_char} was designed to be both fast and run with minimal expansion depth, to allow use in other frequently-used templates. The speed will run about 40% (almost 2x times) faster than Template:Strfind_short, due to checking for only 1 character, and not needing to add the length of the search-string to match within the base string. By returning the count of matching characters in "+1" format (such as "+1+1+1+1") then the expansion depth avoids the one extra level needed to run function " ", which can be run as an optional extra step by the calling page, only when the total count is needed.

To increase speed, the comparison of characters is bounded by the rare characters "ŵø" and so a search with "ŵ" might match multiple times.