substring: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Macros:Functions:substring moved to substring) |
Verisimilar (talk | contribs) m (Added version.) |
||
Line 1: | Line 1: | ||
{{MacroFunction | {{MacroFunction | ||
|name=substring | |name=substring | ||
|version=1.3b48 | |||
|description= | |description= | ||
Returns the substring of the string from the start to the end indexes. Indexes for strings start at 0. If the end parameter is not specified then the substring extends to the end of the string. | Returns the substring of the string from the start to the end indexes. Indexes for strings start at 0. If the end parameter is not specified then the substring extends to the end of the string. | ||
Line 6: | Line 7: | ||
|usage= | |usage= | ||
<source lang="mtmacro" line> | <source lang="mtmacro" line> | ||
substring(str, start) | |||
</source> | |||
<source lang="mtmacro" line> | |||
substring(str, start, end) | |||
</source> | </source> | ||
Revision as of 11:32, 10 March 2009
substring() Function
• Introduced in version 1.3b48
Returns the substring of the string from the start to the end indexes. Indexes for strings start at 0. If the end parameter is not specified then the substring extends to the end of the string.
Usage
substring(str, start)
substring(str, start, end)
Examples
[substring("This is a test", 5)]
[substring("This is a test", 5, 7)]
Returns
is a testis