This is the {{Str len}} meta-template.

It takes a string as parameter and returns its length (excluding spaces at the start and end). It can now count as high as necessary.

Examples 𐌹𐌽𐌼𐌰𐌹𐌳𐌴𐌹

If the parameter is empty or undefined it is considered to be of zero length:

{{Str len}} returns 0
{{Str len|}} returns 0
{{Str len| }} returns 0

It counts the length correctly, even if the string contains spaces, looks like a number, or contains special characters:

{{Str len| ab cde }} returns 6
{{Str len| 1234567 }} returns 7
{{Str len| cafΓ© Γ₯Àâ }} returns 8
{{Str len| 499-characters... }} returns 499
{{Str len| 1000-characters... }} returns 999

Template data 𐌹𐌽𐌼𐌰𐌹𐌳𐌴𐌹

This is the TemplateData documentation for this template used by VisualEditor and other tools.

TemplateData for Str len

The template takes a string as parameter and returns its length, excluding spaces at the start and end of the string

Template parameters

ParameterDescriptionTypeStatus
Alpha-numeric text1

The string to be counted

Stringrequired

See also 𐌹𐌽𐌼𐌰𐌹𐌳𐌴𐌹

π†πŒ°πŒΏπ‚πŒ°πŒΌπŒ΄πŒ»πŒ΄πŒΉπŒ½πƒ:String-handling templates