Module:Str find word/doc: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 5:
Implements {{tl|Str find word}}.
 
This module looks for a full word being present in a comma-separated list of words. It then returns a {{code|True}} or {{code|False}} value.
By default, the True-value returned is the found word itself; the False-value is a blank string.
 
For example, in the source string '{{mono|1=alphafoo, foobarbar}}' the word '{{mono|1=alphabar}}' appears, but the word '{{mono|1=foonovember}}' does not: there only is the complete word '{{mono|1=foobar}}'. The module is aimed at template code usage. <small>(The editor does not have to apply Lua patterns like {{code|1=[%a%d]*}})</small>.
:FalseTrue: <code><nowiki>{{#invoke:Str find word|main |source=alphafoo, betabar|word=gammabar}}</nowiki></code> &rarr; >{{#invoke:Str find word|main |source=alphafoo, betabar|word=gammabar}}<
 
:TrueFalse: <code><nowiki>{{#invoke:Str find word|main |source=alpha, beta, gamma|word=betanovember}}</nowiki></code> &rarr; >{{#invoke:Str find word|main |explain=true |source=alpha, beta, gamma|word=betanovember}}<
:False: <code><nowiki>{{#invoke:Str find word|main |source=alpha, beta|word=gamma}}</nowiki></code> &rarr; >{{#invoke:Str find word|main |source=alpha, beta|word=gamma}}<
 
''Complete words: the complete word is '{{mono|1=foobar}}'.