endsWith: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Text replacement - "source>" to "syntaxhighlight>")
m (Text replacement - "<source" to "<syntaxhighlight")
 
Line 5: Line 5:


|usage=
|usage=
<source lang="mtmacro" line>
<syntaxhighlight lang="mtmacro" line>
[h: result = endsWith(str, substr)]
[h: result = endsWith(str, substr)]
</syntaxhighlight>
</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")]

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