startsWith: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
(New page: ==Function startsWith== '''Introduced in MapTool 1.3b49''' Returns 1 if the string starts with a certain sub string. ===Usage=== <source lang="mtmacro" line> [h: result = startsWith(st...)
 
m (Applied Template:MacroFunction)
Line 1: Line 1:
==Function startsWith==
{{MacroFunction
 
|name=startsWith
 
|version=1.3b49
'''Introduced in MapTool 1.3b49'''
|description
 
Returns 1 if the string starts with a certain sub string.
Returns 1 if the string starts with a certain sub string.


===Usage===
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: result = startsWith(str, substr)]
[h: result = startsWith(str, substr)]
</source>
</source>


 
|examples=
===Examples===
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[r: endsWith("Test", "T")]
[r: endsWith("Test", "T")]
Line 23: Line 21:
     1
     1
     0
     0
}}
[[Category:String Function]]

Revision as of 05:06, 9 March 2009

startsWith() Function

Introduced in version 1.3b49

Usage

[h: result = startsWith(str, substr)]

Examples

[r: endsWith("Test", "T")]
[r: endsWith("Test", "Te")]
[r: endsWith("Test", "Tez")]

Returns

   1
   1
0