endsWith: Difference between revisions
Jump to navigation
Jump to search
(New page: ==Function endsWith== '''Introduced in MapTool 1.3b49''' Returns 1 if the string ends with a certain sub string. ===Usage=== <source lang="mtmacro" line> [h: result = endsWith(str, sub...) |
m (Text replacement - "<source" to "<syntaxhighlight") |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
= | {{MacroFunction | ||
|name=endsWith | |||
|version=1.3b49 | |||
|description=Returns 1 if the string ends with a certain sub string. | |||
|usage= | |||
<syntaxhighlight lang="mtmacro" line> | |||
< | |||
[h: result = endsWith(str, substr)] | [h: result = endsWith(str, substr)] | ||
</ | </syntaxhighlight> | ||
|examples= | |||
< | <syntaxhighlight lang="mtmacro" line> | ||
[r: endsWith("Test", "t")] | [r: endsWith("Test", "t")] | ||
[r: endsWith("Test", "st")] | [r: endsWith("Test", "st")] | ||
[r: endsWith("Test", "z")] | [r: endsWith("Test", "z")] | ||
</ | </syntaxhighlight> | ||
Returns | Returns | ||
Line 23: | Line 20: | ||
1 | 1 | ||
0 | 0 | ||
}} | |||
[[Category:String Function]] |
Latest revision as of 23:59, 14 March 2023
endsWith() Function
• Introduced in version 1.3b49
Returns 1 if the string ends with a certain sub string.
Usage
[h: result = endsWith(str, substr)]
Examples
[r: endsWith("Test", "t")]
[r: endsWith("Test", "st")]
[r: endsWith("Test", "z")]
Returns
1 10