Template:Trim leading
閱讀設定
x
用法
[編輯]{{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.
限制
[編輯]- New code should strongly consider Module:string (傾 · · 史 · 有乜連過嚟 · 解 · 子頁面 · 測試 – 結果 · 測試 – 結果) or Module:MultiReplace (傾 · · 史 · 有乜連過嚟 · 解 · 子頁面 · 測試 – 結果 · 測試 – 結果).
- For backward compatibility, both the input and pattern string are trimmed of surrounding whitespace before processing begins. This means you cannot remove three instances of "the " from "the the the thing"; instead you will remove one instance of "the".
例子
[編輯]{{Trim leading |duck duck duck goose |duck}}
→ duck duck goose
{{Trim leading | duckduckduckgoose |duck}}
→ goose
{{Trim leading | 00000034 }}
→ 34
{{Trim leading | aaaaaa34| a }}
→ 34
{{Trim leading | U+0034|U+}}
→ 0034
{{Trim leading |anti-anti-neutrino |anti-}}
→ neutrino
睇埋
[編輯]Template:String-handling templates
上面嘅解係穿透包含咗自Template:Trim leading/doc。 (改 | 史) 編者可以響呢個模嘅沙盤 (開 | 鏡)同埋試例 (開)版度試驗佢。 請加個類到個/doc嘅細版度。 呢個模嘅細版。 |