Template:Posnq/doc

模板页面

Wrapper template for function posnq in Module:String2.

  • posnq (position, no quotes) returns the numerical start position of the first occurrence of one piece of text ("match") inside another ("str").
  • It returns nil if no match is found, or if either parameter is blank.
  • It takes the text to be searched in as the first unnamed parameter, which is trimmed.
  • It takes the text to match as the second unnamed parameter, which is trimmed and any double quotes " are stripped out. That allows spaces at the beginning or end of the match string to be included in a consistent manner.

Examples

  • {{Posnq |This is a piece of text to be searched |piece of }} → 11
  • {{Posnq |This is a piece oftext to be searched |piece of }} → 11
  • {{Posnq |This is a piece of text to be searched |"piece of "}} → 11
  • {{Posnq |This is a piece oftext to be searched |"piece of "}}
我们提供服务需要使用Cookie。您使用我们的服务,即表示您同意我们使用Cookie。