startsWith: Difference between revisions
Jump to navigation
Jump to search
Verisimilar (talk | contribs) m (Applied Template:MacroFunction) |
No edit summary |
||
(12 intermediate revisions by 8 users not shown) | |||
Line 2: | Line 2: | ||
|name=startsWith | |name=startsWith | ||
|version=1.3b49 | |version=1.3b49 | ||
|description | |description= | ||
Returns | Returns {{true}} if the first parameter starts with the contents of the second parameter. | ||
|usage= | |usage= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[h: result = startsWith( | [h: result = startsWith(string, substring)] | ||
</ | </syntaxhighlight> | ||
Returns {{true}} if the string starts with a certain substring and {{false}} if not. | |||
|examples= | |examples= | ||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: | [r: startsWith("Test", "T")] | ||
[r: | [r: startsWith("Test", "Te")] | ||
[r: | [r: startsWith("Test", "Tez")] | ||
</ | </syntaxhighlight> | ||
Returns | '''Returns''' | ||
<pre> 1 | |||
1 | |||
0</pre> | |||
}} | }} | ||
[[Category:String Function]] | [[Category:String Function]] |
Latest revision as of 23:59, 14 March 2023
startsWith() Function
• Introduced in version 1.3b49
Returns
true
(1
) if the first parameter starts with the contents of the second parameter.Usage
[h: result = startsWith(string, substring)]
Returns true
(1
) if the string starts with a certain substring and false
(0
) if not.
Examples
[r: startsWith("Test", "T")]
[r: startsWith("Test", "Te")]
[r: startsWith("Test", "Tez")]
Returns
1 1 0