模板:Str find/doc:修订间差异
ahp>Mifield 小 (move high-use template to top) |
小 (导入1个版本) |
(没有差异)
|
2023年11月7日 (二) 16:50的最新版本
Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
Usage
Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
Returns the position of first appearance of sub_string in text.
- The comparison is case sensitive.
- Returns -1 if sub_string not found
- Character position is 1 based (not 0 based as usual in calculations).
- If sub_string is empty, this routine returns 1. This case will often have to be handled specially.
Examples
In the examples, the string to be searched is <syntaxhighlight lang="text" class="" id="" style="" inline="1">Abcdefghijklm</syntaxhighlight>:
- A; Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
- a; Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
- def; Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
- klm; Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
- zyx; Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
- empty;klm;Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
- empty;empty; Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
TemplateData
TemplateData for Str find
Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted
<templatedata> {
"description": "A template to find the numeric position of first appearance of sub_string in text", "params": { "1": { "label": "Text", "description": "The text to search within", "type": "string", "required": true }, "2": { "label": "Sub_string", "description": "The string to be searched within the text", "type": "string", "required": true } }
} </templatedata>
See also
Lua错误:无法创建进程:proc_open(/dev/null): failed to open stream: Operation not permitted