startsWith: Difference between revisions

From RPTools Wiki
Jump to navigation Jump to search
mNo edit summary
m (Fixing the formatting of the example output.)
Line 19: Line 19:
</source>
</source>


Returns
Returns<pre>
     1
     1
     1
     1
     0
     0</pre>
}}
}}
[[Category:String Function]]
[[Category:String Function]]

Revision as of 14:15, 1 March 2019

startsWith() Function

Introduced in version 1.3b49
Returns true(1) if the first parameter starts with the contents of the second parameter.

Usage

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

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

Examples

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