Core Function StartsWith
From Sputnik Wiki
StartsWith( <expression>, <expression2>, <flag> )
Contents |
Description
Check if a string starts with a substring.
Parameters
expression
The string to evaluate.
expression2
The substring to use.
flag
Optional; If flag is higher than 0 then it will be case insensitive.
Default is case sensitive.
Return Value
Success: Returns 1.
Failure: Returns 0.
Remarks
None.
Example
$str = "I'm a string"; println( StartsWith($str, "I'm") ); // True println( StartsWith($str, "i'm") ); // False println( StartsWith($str, "i'm", 1) ); // True