"سانچہ:Str number/trim" کے نسخوں کے درمیان فرق
ur>Wikivahdat م (Changed protection level for "Template:Str number/trim": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))) |
م (1 نسخہ درآمد کیا گیا) |
(کوئی فرق نہیں)
|
حالیہ نسخہ بمطابق 05:56، 4 دسمبر 2022ء
فائل:Lua-Logo.svg | This template uses Lua: |
فائل:Ambox warning yellow.svg | This template is used on approximately 34,000 pages and changes may be widely noticed. Test changes in the template's /sandbox or /testcases subpages, or in your own user subpage. Consider discussing changes on the talk page before implementing them. |
The Template:Str_number/trim extracts a number at the start of parameter 1.
It takes a string as parameter, and returns the string trimmed to the beginning number if non-numeric text does not appear before the first number.
Examples
{{Str number/trim}}
→{{Str number/trim|abcde}}
→{{Str number/trim|abcde123}}
→{{Str number/trim|123456}}
→ 123456{{Str number/trim|123 456}}
→ 123{{Str number/trim|1976–2006}}
→ 1976{{Str number/trim|19/76+2006}}
→ 19{{Str number/trim|19 (302)}}
→ 19{{Str number/trim|1234abc}}
→ 1234{{Str number/trim|1234abc56}}
→ 1234{{Str number/trim|12345678901234567890}}
→ 12345678901234567890{{Str number/trim|1234567890123456789012345}}
→ 1234567890123456789012345{{Str number/trim| 1234567890123456789012345}}
→ 1234567890123456789012345{{Str number/trim|13<ref>a reference</ref>}}
→ 13
See also
References
- ↑ a reference