打开/关闭搜索
搜索
打开/关闭菜单
1
1
1
239
Tiancheng Wiki
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
上传文件
打开/关闭外观设置菜单
notifications
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
中文(中国大陆)
个人工具
创建账号
登录
查看“︁模板:字串模板一覽”︁的源代码
来自Tiancheng Wiki
查看
阅读
查看源代码
查看历史
associated-pages
模板
讨论
更多操作
←
模板:字串模板一覽
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
<noinclude>{{NoteTA |G1=IT }}</noinclude>{{Navbox with collapsible groups | name = 字串模板一覽 | state = {{{state|expanded}}} | bodyclass = plainlist | title = 字符串處理模板 | selected = {{{selected|{{{expanded|{{{1|}}}}}}}}} <!---------------------- Trimming -------------------------> | abbr1 = trim | sect1 = {{tsl|en|Trimming (computer programming)|Trim (編程)|切短}} | list1 = {{Navbox|child |group1 = 根据数量处理 | list1 = {{Aligned table |fullwidth=on |style=text-align:left; |col1width=50%; | {{Aligned table |style=padding-right:2.5em; |col1style=width:12.5em;text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|str mid}} | 按位置及長度選取子串。 | {{tl|trunc}} | 切短到规定的字数。 | {{tl|str left}} | 切短或重复填充到规定的字数。 | {{tl|str crop}} | 從末尾切短特定數量的字元。 | {{tl|chop head and tail}} | To crop a specified number of characters off the beginning and end. }} | {{Aligned table |col1style=width:12.5em;text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|str right}} | 返回从左向右移除若干个字符后的字符串 | {{tl|str rightc}} | 返回从后向前指定数量的字符串,如果字符串为空则返回一个参数 | {{tl|str sub old}} | To trim down to a specified number, starting at a given number from the left. | {{tl|str sub new}} | Select a substr based on starting and ending index. | {{tl|str index}} | 返回字符串的第×个字符 }} }} | group2 = 根据条件处理 | list2 = {{Aligned table |fullwidth=on |style=text-align:left; |col1width=50%; | {{Aligned table |style=padding-right:2.5em; |col1style=width:12.5em;text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|trim}} | 移除首尾空格。 | {{tl|str letter/trim}} | To trim down to the beginning letters. | {{tl|str number/trim}} | To trim down to the beginning numbers. | {{tl|trim brackets}} | To trim any leading or trailing square brackets. | {{tl|trim quotes}} | To trim leading or trailing matches quotes. }} | {{Aligned table |col1style=width:12.5em;text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|String split}} | 從長字符串中抽取短字符串。 | {{tl|first word}} | 切短至首個空格前。 | {{tl|remove first word}} | 移除首個空格前的內容。 | {{tl|last word}} | 切短至最後一個空格前。 | {{tl|remove last word}} | 移除最後一個空格前的內容。 }} }} | group3 = 专用于Wiki语法 | list3 = {{Aligned table |fullwidth=on |style=text-align:left; |col1width=50%; | {{Aligned table |style=padding-right:2.5em; |col1style=width:12.5em;text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|除鏈}}<!-- delink --> | 去除Wiki連結的括號(Wiki代碼)。 | {{tl|remove file prefix}} | 從檔案名中去除「File:」(或「Image:」)。 | {{tl|PAGENAMEBASE}} | 去除字串末尾的括號文本(消歧義)。 | {{tl|title disambig text}} | 返回字串末尾的括號文本(消歧義)。 }} | {{Aligned table |col1style=width:12.5em;text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|WikiProjectbasename}} | Removes "WikiProject" from a pagename. | {{tl|remove unranked}} | Removes the string "unranked_" from the left of a string (taxonomy). | {{tl|ship prefix}} | Returns the length of a ship's name prefix, if listed (ship names). | {{tl|title year}} | Returns the 4-digit year from a pagename, if any. }} }} }} <!----------- Insertion, replacement, length --------------> | abbr2 = IRL | sect2 = 插入、替換、長度 | list2 = {{Aligned table |style=margin:0 auto 0;text-align:left; | <!---(Insertion, replacement)---> {{Aligned table |style=padding-right:2.5em; |col1style=text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|strloc insert}} | Inserts a string at character location strloc, or appends if strloc<{{=}}0. | {{tl|loop}} | 特定次數重複字串。 | {{tl|replace}} | 在字串中查找並全部替換某字串後返回。 | {{tl|str rep}} | 在字串中查找並替換首次出現的某字串後返回。 | {{tl|digits}} | 移除字串中不是數字(0~9)的字元。 }} | <!---(Length)---> {{Aligned table |col1style=text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|str len}} | 返回字串長度。 | {{tl|str ≥ len}} | 檢查一個字串和某一給定長度相比是「更長或等長」還是「更短」。 | {{tl|str ≤ len}} | 檢查一個字串和某一給定長度相比是「更短或等長」還是「更長」。 | {{tl|str ≠ len}} | 檢查一個字串和某一給定長度相比是「不等長」還是「等長」。 | {{tl|str ≤ ≥ len}} | 檢查一個字串和某一給定長度相比是「更短」、「等長」還是「更長」。 }} }} <!----------------- Analysis, technical -------------------> | abbr3 = anlys/tech | sect3 = 分析、技術 | list3 = {{Aligned table |style=margin:0 auto 0;text-align:left; | <!---(Analysis)---> {{Aligned table |style=padding-right:2.5em; |col1style=text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|str endswith}} | 检查是否以给定的字符串结尾。 | {{tl|str find}}<br/>{{tl|strfind short}} |style2.2=vertical-align:middle;|''在一個字串中搜尋並返回特定字串的位置。'' | {{tl|str find0}} | Zero-based substring search. | {{tl|str sub find}} | 从指定的偏移量开始搜索一个子字符串。 | {{tl|str letter}} | 返回一个字符串开头的所有字符。 | {{tl|str number}} | 返回一个字符串开头的所有数字。 | {{tl|str gtr str}} | 判断两个字符串是否相等,然后根据返回相应的值。 | {{tl|str match}} | 在一個字串中对正则表达式的查询结果进行分捕获组的输出。 }} | <!---(Analysis cont'd)---> {{Aligned table |col1style=text-align:right;white-space:nowrap;padding-right:0.75em; <!--|col2style=font-family:serif;--> | {{tl|ASCII code}} | 返回单个字符的ASCII码值 | {{tl|a or an}} | Takes a noun and produces the appropriate indefinite article, based on whether the first letter is a vowel. | | <!---(Technical)---> | [[Module:String]] | | [[mw:Help:Magic words|...Magic words]] | {{noitalic|About <code><nowiki>{{padleft:|}}</nowiki></code>.}} | [[mw:Help:Extension:ParserFunctions|...ParserFunctions]] | {{noitalic|About <code><nowiki>{{#titleparts:|}}, {{#expr:|}}, {{#ifeq:|}}, </nowiki></code> etc.}} }} }} <!--------------------- (disabled) ------------------------> <!---- | group12 = 功能請求 | list12 = * [[bugzilla:6455]] – Set $wgPFEnableStringFunctions = true on WMF wikis * [[bugzilla:26092]] – Enable or install string parsing wikimarkup functionality on WMF wikis <!----Not in a navbox: | group13 = [[Wikipedia:Template sandbox and test cases|Sandboxes, testcases]] | list13 = * {{tl|Str find/sandbox}} * {{tl|Str index/getchar/sandbox}} * {{tl|Str index/getchar/testcases}} * {{tl|Str index/sandbox}} * {{tl|Str index/testcases}} * {{tl|Str index any/sandbox}} * {{tl|Str index any/testcases}} * {{tl|Str left/sandbox}} * {{tl|Str len/core/sandbox}} * {{tl|Str len/sandbox}} * {{tl|Str len/testcases}} * {{tl|Str rightc/testcases}} * {{tl|Str ≠ len/sandbox}} * {{tl|Str ≠ len/testcases}} -----> <!----------------------- below ---------------------------> | belowclass = hlist | below = * [[:Category:字符串處理模板]] * [[m:Category:String templates]] * [[:commons:Category:字符串處理模板]] | tracking = no <!--(keep all these string templates (by /doc pages) out of the tracking category)--> }}<noinclude>{{Documentation}}</noinclude>
返回
模板:字串模板一覽
。
查看“︁模板:字串模板一覽”︁的源代码
来自Tiancheng Wiki