Module:Substring?/doc

From Wikinews, the free news source you can write!
Jump to navigation Jump to search

Function[edit]

A single function check is exported, for use by {{substring?}}. Function check returns blank unless the second parameter occurs within the first, in which case it returns the 1-indexed position of the second parameter within the first.

The substring-check by this module is not meant to be part of a larger suite of string-manipulation tools. Use Module:Wikilisp for general string manipulation. Sometimes a page contains very many operations that can almost be handled using magic words, but fall short because they need to distinguish between cases in a way that this module can provide. In such a situation, this module should afford a huge savings over Module:Wikilisp, even if the more general tool is used for some rare cases selected using this tool.