跳至內容
主選單
主選單
移至側邊欄
隱藏
开始
投掷虚舟
最近更改
导航
特殊页面
轻之舟百科
搜尋
搜尋
中文(繁體)
外觀
建立帳號
登入
個人工具
建立帳號
登入
用於已登出編輯者的頁面
了解更多
貢獻
討論
模板
:
字串模板一覽
模板
討論
繁體
不转换
简体
繁體
大陆简体
香港繁體
澳門繁體
大马简体
新加坡简体
臺灣正體
閱讀
編輯原始碼
檢視歷史
工具
工具
移至側邊欄
隱藏
操作
閱讀
編輯原始碼
檢視歷史
一般
連結至此的頁面
相關變更
上傳檔案
可列印版
固定連結
頁面資訊
外觀
移至側邊欄
隱藏
出自轻之舟百科
(重新導向自
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
搜尋
搜尋
模板
:
字串模板一覽
新增語言
新增話題