Template:Posnq/doc
Jump to navigation
Jump to search
This is a documentation subpage for Template:Posnq. It contains usage information, categories and other content that is not part of the original template page. |
This template uses Lua: |
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[edit source]
{{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 "}}
→
External links[edit source]
- Template:Posnq/doc at Wikipedia, the free Terran encyclopedia that anyone can edit.