Templat:Trim leading/doc: Perbedaan antara revisi

Konten dihapus Konten ditambahkan
Baru
 
 
Baris 2:
<!-- Categories and interwikis go at the bottom of this page. -->
 
== UsagePenggunaan ==
{{tlx|Trim leading | &lt;input&gt;&nbsp;| &lt;prefix&gt;&nbsp;}}
 
Trims up to six instances of &lt;prefix&gt; (such as: 0 or "anti-") from the beginning of &lt;input&gt;. &lt;Prefix&gt; is set to "0" by default (for removing leading zeroes from numbers). Template will not properly work beyond the first whitespace in the input.
 
=== LimitationsPembatasan ===
* 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.
 
== ExamplesContoh ==
{{tlx|Trim leading |duck duck duck goose&nbsp;|duck }} &rarr; {{Trim leading |duck duck duck goose |duck }}
 
Baris 26:
{{tlx|Trim leading |anti-anti-neutrino&nbsp;|anti-}} &rarr; {{Trim leading |anti-anti-neutrino |anti-}}
 
== TechnicalTeknis ==
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.
 
== SeeLihat alsojuga ==
{{string-handling templates}}
 
 
<includeonly>
<!-- Categories and interwikis go here: -->
[[Kategori:Templat manipulasi string]]
[[Category:String manipulation templates]]
</includeonly>