endsWith: Difference between revisions

From RPTools Wiki
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")
 
(5 intermediate revisions by 3 users not shown)
Line 1: Line 1:
==Function endsWith==
{{MacroFunction
|name=endsWith
|version=1.3b49
|description=Returns 1 if the string ends with a certain sub string.


 
|usage=
'''Introduced in MapTool 1.3b49'''
<syntaxhighlight lang="mtmacro" line>
 
Returns 1 if the string ends with a certain sub string.
 
===Usage===
<source lang="mtmacro" line>
[h: result = endsWith(str, substr)]
[h: result = endsWith(str, substr)]
</source>
</syntaxhighlight>
 


===Examples===
|examples=
<source lang="mtmacro" line>
<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")]
</source>
</syntaxhighlight>


Returns
Returns
Line 23: Line 20:
     1
     1
     0
     0
}}
[[Category:String Function]]

Latest revision as of 18:27, 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
   1
0