• 首页
  • 随机
  • 登录
  • 设置
  • 关于Kyoshihira Encyclopedia
  • 免责声明
Kyoshihira Encyclopedia

Template:字串模板一覽

  • 语言
  • 监视
  • 查看源代码
(重定向自Template:字符串模板參見文字)
  • 查
  • 论
  • 编
字符串處理模板
切短(英语:Trimming (computer programming))
根据数量处理
{{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 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}} 判断两个字符串是否相等,然后根据返回相应的值。
{{str match}} 在一個字串中对正则表达式的查询结果进行分捕获组的输出。
{{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:字符串處理模板
  • m:Category:String templates
  • commons:Category:字符串處理模板
File:Test Template Info-Icon - Version (2).svg 模板文档[创建][清除缓存]
编者可以在本模板的沙盒(创建 | 镜像)和测试样例(创建)页面进行实验。
请在/doc子页面中添加分类。本模板的子页面。
检索自“http://wiki.kyoshihira.uk/index.php?title=Template:字串模板一覽&oldid=1999”
最后编辑于2025年6月30日 (星期一) 07:55

语言

  • 不转换
  • 简体
  • 繁體
  • 大陆简体
  • 香港繁體
  • 澳門繁體
  • 大马简体
  • 新加坡简体
  • 臺灣正體
Kyoshihira Encyclopedia
  • 此页面最后编辑于2025年6月30日 (星期一) 07:55。
  • 除非另有声明,本网站内容采用知识共享署名-非商业性使用-相同方式共享授权。
  • 隐私政策
  • 关于Kyoshihira Encyclopedia
  • 免责声明
  • 桌面版