startsWith: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
|usage=
|usage=
<source lang="mtmacro" line>
<source lang="mtmacro" line>
[h: result = startsWith(str, substr)]
[h: result = startsWith(string, substring)]
</source>
</source>


Returns 1 (true) if the string (str) starts with a certain sub string (substr) and 0 (false) if not.  
Returns 1 (true) if the string starts with a certain substring and 0 (false) if not.


|examples=
|examples=

Revision as of 10:41, 5 July 2012

startsWith() Function

Introduced in version 1.3b49

Usage

[h: result = startsWith(string, substring)]

Returns 1 (true) if the string starts with a certain substring and 0 (false) if not.

Examples

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

Returns

   1
   1
0