Template:Strlen short/doc

< Template:Strlen short

The Template:Strlen_short gives the length of parameter 1, as a text string, with a count of 0-50 text characters, using a simple, quick method. The template was designed to use only 2 levels of expansion depth, rather than 9-13 or more levels as in other string-length templates.

Usage:  {{strlen short|abcdef}}       → 6
{{strlen short|123456789.}} → 10
{{strlen short|2.4| extra= -1}} → 3

The optional parameter "extra= -1" can be used to return a specific value when a string exceeds the 50-character limit. The default result is -1 to indicate a string longer than 50 characters.

Related pages

  • {{Strlen_quick}} - to get string lengths quickly up to 1-60, but as expansion depth 5.
  • {{Str len}} - handles strings up to 500 long, but with expansion depth 9-13 or more.