用法
- 基本
模板链接:{{除鏈|文本}}
- 所有參數
{{除鏈
|1=
|wikilinks = no
|urls = no
|comments = no
|whitespace = no
|refs = yes
}}
參數
1
:要除鏈的文字
wikilinks
:設為no、n、false或0時,維基連結不會被除去
urls
:設為no、n、false或0時,網址鏈不會被除去
comments
:設為no、n、false或0時,HTML註解不會被去除
whitespace
:設為no、n、false或0時,空格不會被正常化。空格正常化會使結果文本看起來經過MediaWiki的語法分析器,例如空數格和換行皆顯示為一個空格,而空行則不轉換。
refs
:(測試中)設為yes、y、true或1時去除引註連結。不建議使用,因只會去除[1][2]等標記,引註文字仍會出現在頁底。
範例
原文
|
代碼
|
顯示
|
求聞百科
|
{{除鏈|[[求聞百科]]}}
|
求聞百科
|
香蕉、蘋果和鳳梨
|
{{除鏈|[[香蕉]]、[[蘋果]]和[[鳳梨]]}}
|
香蕉、蘋果和鳳梨
|
動物界、植物界
|
{{除鏈|[[动物|动物界]]、[[植物界]]}}
|
動物界、植物界
|
我常造訪求聞百科
|
{{除鏈|我常造訪[https://www.qiuwen.wiki/wiki/Qiuwen:首页 求聞百科]}}
|
我常造訪求聞百科
|
我常造訪[1]
|
{{除鏈|我常造訪[https://www.qiuwen.wiki/wiki/Qiuwen:首页]}}
|
我常造訪
|
這是File:Example-zh.jpg:
|
{{除鏈|這是[[:File:Example-zh.jpg]]:<br/>[[File:Example-zh.jpg]]}}
|
這是File:Example-zh.jpg:
|
參見
根據數量處理
| 模板鏈接:{{str right}} | 返回從左向右移除若干個字符後的字符串 | 模板鏈接:{{str rightc}} | 返回從後向前指定數量的字符串,如果字符串為空則返回一個參數 | 模板鏈接:{{str rightmost}} | To trim down to the last specified number of characters. | 模板鏈接:{{str sub old}} | To trim down to a specified number, starting at a given number from the left. | 模板鏈接:{{str sub new}} | Select a substr based on starting and ending index. | 模板鏈接:{{str index}} | 返回字符串的第×個字符 |
|
根據條件處理
專用於Wiki語法
| 模板鏈接:{{WikiProjectbasename}} | Removes "WikiProject" from a pagename. | 模板鏈接:{{remove unranked}} | Removes the string "unranked_" from the left of a string (taxonomy). | 模板鏈接:{{ship prefix}} | Returns the length of a ship's name prefix, if listed (ship names). | 模板鏈接:{{title year}} | Returns the 4-digit year from a pagename, if any. |
|
插入、替換、長度
模板鏈接:{{strloc insert}} | Inserts a string at character location strloc, or appends if strloc<=0. | 模板鏈接:{{loop}} | 特定次數重複字串。 | 模板鏈接:{{replace}} | 在字串中查找並全部替換某字串後返回。 | 模板鏈接:{{str rep}} | 在字串中查找並替換首次出現的某字串後返回。 | 模板鏈接:{{digits}} | 移除字串中不是數字(0~9)的字元。 |
|
模板鏈接:{{str len}} | 返回字串長度。 | 模板鏈接:{{str ≥ len}} | 檢查一個字串和某一給定長度相比是「更長或等長」還是「更短」。 | 模板鏈接:{{str ≤ len}} | 檢查一個字串和某一給定長度相比是「更短或等長」還是「更長」。 | 模板鏈接:{{str ≠ len}} | 檢查一個字串和某一給定長度相比是「不等長」還是「等長」。 | 模板鏈接:{{str ≤ ≥ len}} | 檢查一個字串和某一給定長度相比是「更短」、「等長」還是「更長」。 |
|
分析、技術