endsWith: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
m (Conversion script moved page EndsWith to endsWith: Converting page titles to lowercase)
m (Text replacement - "source>" to "syntaxhighlight>")
Line 7: Line 7:
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: result = endsWith(str, substr)]
[h: result = endsWith(str, substr)]
</source>
</syntaxhighlight>


|examples=
|examples=
Line 14: Line 14:
[r: endsWith("Test", "st")]
[r: endsWith("Test", "st")]
[r: endsWith("Test", "z")]
[r: endsWith("Test", "z")]
</source>
</syntaxhighlight>


Returns
Returns

Revision as of 17:06, 14 March 2023

endsWith() Function

Introduced in version 1.3b49
Returns 1 if the string ends with a certain sub string.

Usage

<source lang="mtmacro" line> [h: result = endsWith(str, substr)] </syntaxhighlight>

Examples

<source lang="mtmacro" line>

[r: endsWith("Test", "t")] [r: endsWith("Test", "st")] [r: endsWith("Test", "z")] </syntaxhighlight>

Returns

   1
   1
0