Templat:Trim leading/doc: Perbedaan antara revisi
Konten dihapus Konten ditambahkan
JohnThorne (bicara | kontrib) Baru |
k Cleanup. |
||
Baris 2:
<!-- Categories and interwikis go at the bottom of this page. -->
==
{{tlx|Trim leading | <input> | <prefix> }}
Trims up to six instances of <prefix> (such as: 0 or "anti-") from the beginning of <input>. <Prefix> is set to "0" by default (for removing leading zeroes from numbers). Template will not properly work beyond the first whitespace in the input.
===
* Up to 100 chararacters in the input string. If possible, first check length of input string using {{Tl|Str len|<string>}}. Using strings longer than 100 characters may result in the error '''''"<span style="color:#CC1100">max index is 100 for str_sub</span>"'''''.
* Limited set of characters.
Baris 13:
* Expensive.
==
{{tlx|Trim leading |duck duck duck goose |duck }} → {{Trim leading |duck duck duck goose |duck }}
Baris 26:
{{tlx|Trim leading |anti-anti-neutrino |anti-}} → {{Trim leading |anti-anti-neutrino |anti-}}
==
This template uses parser function {padleft}. It formerly called 6 subtemplates: [[Template:Trim leading/1]], [[Template:Trim leading/2|/2]] ... [[Template:Trim leading/6|/6]], which are all functionally identical, allowing for up to six instantiations of ''prefix'' to be removed.
==
{{string-handling templates}}
<includeonly>
<!-- Categories and interwikis go here: -->
[[Kategori:Templat manipulasi string]]
</includeonly>
|