Your IP address will be publicly visible if you make any edits.
Template:Str number/doc
Template page
More actions
Revision as of 05:58, 16 February 2025 by Prd(talk | contribs)(Created page with "{{high use}} {{Documentation subpage}} {{lua|Module:String}} <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> This is the {{tl|str number}} meta-template. It takes a string as parameter, and returns the number of leading digits. It does not handle negative numbers or decimals, and stops at any minus sign '-' or dot '.' symbols. === Examples === If the parameter is empty or undefined, zero is returned: :<code><nowiki>{{str number}}</nowiki...")
It takes a string as parameter, and returns the number of leading digits. It does not handle negative numbers or decimals, and stops at any minus sign '-' or dot '.' symbols.
Examples
If the parameter is empty or undefined, zero is returned:
{{str number}} returns 0
{{str number|}} returns 0
{{str number| }} returns 0
The count is interrupted by anything but the ten digits: