跳转到内容
主菜单
主菜单
移至侧栏
隐藏
开始
投掷虚舟
最近更改
导航
特殊页面
轻之舟百科
搜索
搜索
中文
外观
创建账号
登录
个人工具
创建账号
登录
未登录编辑者的页面
了解详情
贡献
讨论
Template
:
字串模板一覽
模板
讨论
不转换
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
阅读
编辑源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
编辑源代码
查看历史
常规
链入页面
相关更改
上传文件
可打印版
固定链接
页面信息
外观
移至侧栏
隐藏
轻之舟百科,让知识轻装启航
(重定向自
Template:String-handling templates
)
查
论
编
字符串處理模板
切短
根据数量处理
模板链接:
{{
str mid
}}
按位置及長度選取子串。
模板链接:
{{
trunc
}}
切短到规定的字数。
模板链接:
{{
str left
}}
切短或重复填充到规定的字数。
模板链接:
{{
str crop
}}
從末尾切短特定數量的字元。
模板链接:
{{
chop head and tail
}}
To crop a specified number of characters off the beginning and end.
模板链接:
{{
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
}}
返回字符串的第×个字符
根据条件处理
模板链接:
{{
trim
}}
移除首尾空格。
模板链接:
{{
str letter/trim
}}
To trim down to the beginning letters.
模板链接:
{{
str number/trim
}}
To trim down to the beginning numbers.
模板链接:
{{
trim brackets
}}
To trim any leading or trailing square brackets.
模板链接:
{{
trim quotes
}}
To trim leading or trailing matches quotes.
模板链接:
{{
String split
}}
從長字符串中抽取短字符串。
模板链接:
{{
first word
}}
切短至首個空格前。
模板链接:
{{
remove first word
}}
移除首個空格前的內容。
模板链接:
{{
last word
}}
切短至最後一個空格前。
模板链接:
{{
remove last word
}}
移除最後一個空格前的內容。
专用于Wiki语法
模板链接:
{{
除鏈
}}
去除Wiki連結的括號(Wiki代碼)。
模板链接:
{{
remove file prefix
}}
從檔案名中去除「File:」(或「Image:」)。
模板链接:
{{
PAGENAMEBASE
}}
去除字串末尾的括號文本(消歧義)。
模板链接:
{{
title disambig text
}}
返回字串末尾的括號文本(消歧義)。
模板链接:
{{
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
}}
檢查一個字串和某一給定長度相比是「更短」、「等長」還是「更長」。
分析、技術
模板链接:
{{
str endswith
}}
检查是否以给定的字符串结尾。
模板链接:
{{
str find
}}
模板链接:
{{
strfind short
}}
在一個字串中搜尋並返回特定字串的位置。
模板链接:
{{
str find0
}}
Zero-based substring search.
模板链接:
{{
str sub find
}}
从指定的偏移量开始搜索一个子字符串。
模板链接:
{{
str letter
}}
返回一个字符串开头的所有字符。
模板链接:
{{
str number
}}
返回一个字符串开头的所有数字。
模板链接:
{{
str gtr str
}}
判断两个字符串是否相等,然后根据返回相应的值。
模板链接:
{{
ASCII code
}}
返回单个字符的ASCII码值
模板链接:
{{
a or an
}}
Takes a noun and produces the appropriate indefinite article, based on whether the first letter is a vowel.
Module:String
...Magic words
About
{{padleft:|}}
.
...ParserFunctions
About
{{#titleparts:|}}, {{#expr:|}}, {{#ifeq:|}},
etc.
Category:字符串處理模板
模板文档
[
创建
]
[
清除缓存
]
编者可以在本模板的沙盒
(
创建
|
镜像
)
和测试样例
(
创建
)
页面进行实验。
请在
/doc
子页面中添加分类。
本模板的子页面
。
分类
:
调用重复模板参数的页面
放置于模板的noteTA
搜索
搜索
Template
:
字串模板一覽
添加语言
添加话题