跳转到内容
主菜单
主菜单
移至侧栏
隐藏
开始
投掷虚舟
最近更改
导航
特殊页面
轻之舟百科
搜索
搜索
中文(简体)
外观
创建账号
登录
个人工具
创建账号
登录
未登录编辑者的页面
了解详情
贡献
讨论
模板
:
字串模板一览
模板
讨论
简体
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
阅读
编辑源代码
查看历史
工具
工具
移至侧栏
隐藏
操作
阅读
编辑源代码
查看历史
常规
链入页面
相关更改
上传文件
可打印版
固定链接
页面信息
外观
移至侧栏
隐藏
轻之舟百科,让知识轻装启航
(重定向自
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
搜索
搜索
模板
:
字串模板一览
添加语言
添加话题