Template:Trim brackets
模板文档
This template trims leading and trailing square brackets and whitespace from a string. This is similar to {{delink}}, but it won't remove brackets from the middle of the string. The string should be passed as the first unnamed parameter or using |1=
if your string contains any =
signs. You may substitute this template - that is, if used as {{subst:trim brackets}}
, the resulting wikicode is "clean".
Usage编辑
{{trim brackets|text}}
= text with any leading or trailing square brackets removed (as long as text doesn't contain any =
signs).
{{trim brackets|1=text}}
= text with any leading or trailing square brackets removed.
Example编辑
- "
{{trim brackets|1= [[abc]] }}
" produces "abc".
- "
{{trim brackets|1= [[abc]], [[def]], and [[ghi]] }}
" produces "abc]], def, and [[ghi"
("{{delink|1= [[abc]], [[def]], and [[ghi]] }}
" produces "abc, def, and ghi").
- "
{{trim brackets|1= [[abc|xyz]] }}
" produces "abc|xyz".
Template data编辑
The template trims leading and trailing square brackets from a string.
参数 | 描述 | 类型 | 状态 | |
---|---|---|---|---|
String | 1 | The string to be trimmed | 字符串 | 必需 |
See also编辑
- {{delink}}, which does nearly the exact same thing, but also removes balanced pairs of square brackets that aren't leading and trailing and has additional options.
- {{trim}}
|
🔥 Top keywords: Baike: 首页Special:搜索毛泽东家族榮耀之繼承者天之驕女鐵拳英雄九龍城寨之圍城黃循財背着善宰跑篠崎泫妮妃雅新生 (网络剧)劉偉健斯洛伐克习近平劉俊謙 (香港)李显龙歌手2024佛誕淚之女王2024年泰國羽球公開賽新加坡總理邊佑錫新加坡Energy (組合)庆余年九龍寨城六四事件家族榮耀金智媛彌助菲律宾胖猫跳江事件劉寶傑DAY6林峯張文傑李光耀神耆小子張鳳妮黃世聰Seventeen (組合)维基百科願榮光歸香港中華民國鬼滅之刃 柱訓練篇2024年英雄联盟季中邀请赛中华人民共和国TripleS金秀賢 (男演員)罗伯特·菲佐井柏然2024年世界女排联赛黃偉哲怪獸8號佘詩曼Foodpanda金惠奫新加坡总统香緹·摩爾于北辰 (1968年)王嘉爾笑看風雲排球少年!!角色列表林飛帆郭葦昀馴鹿寶貝翁靜晶猩球崛起:王國誕生ILLIT尼古拉·約基奇春色寄情人周殷廷鬼滅之刃排球少年!!吳釗燮逆天奇案2不夠善良的我們BABYMONSTER李正皓尚达曼BOYNEXTDOOR胡子彤IVE (組合)陳靜 (香港)香港吴作栋黃道十二宮凡希亚·奥伊亚胡宇威長洲太平清醮張員瑛搜查班長1958伍允龍习明泽黄岩岛賴清德偶然遇見的你虽然不是英雄