Module:String/doc
From Wiki
This is the documentation page for Module:String
The String script wraps select functions of the Ustring library. Usage:
{{#invoke:String|FUNCTION|ARG1|ARG2…}}
Character positions within a string are indexed from 1, not zero. The following call to function sub
would, for instance, return the substring "ham".
{{#invoke:String|sub|hamburger|1|3}}
The functions listed below are wrapped and made available. The links are to the String version documentation. These in turn link to the less informative Ustring versions, which are always the ones actually wrapped here.
- find - Differs from the library version in three ways: 1) defaults the 'plain' argument to true; 2) returns the index at which the pattern is found, otherwise zero; and 3) always returns zero when called with an empty string or pattern.
- gsub
- len
- sub
The following additional functions are declared. See the code below for usage instructions.
- charAt