Core Function StartsWith
From Sputnik Wiki
(Difference between revisions)
UberFoX (Talk | contribs)
(Created page with "<pre> StartsWith( <expression>, <expression2>, <flag> ) </pre> === Description === Check if a string starts with a substring. === Parameters === ==== expression ==== The str...")
(Created page with "<pre> StartsWith( <expression>, <expression2>, <flag> ) </pre> === Description === Check if a string starts with a substring. === Parameters === ==== expression ==== The str...")
Latest revision as of 14:08, 2 December 2011
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