模板:Str find/doc

来自About High Performance
ahp>Mifield2023年5月21日 (日) 08:39的版本 (move high-use template to top)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索

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

This is the TemplateData for this template used by TemplateWizard, VisualEditor and other tools. Click here to see a monthly parameter usage report for this template in articles based on this 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