Returns whether the given string starts with the specified prefix.
Syntax
startsWith( string , substring )
string.startsWith( substring )
startsWith( string , substring , offset )
string.startsWith( substring , offset )
Parameters
string
|
the string to check.
|
substring
|
the substring to check for.
|
offset
|
a starting offset.
|
Returns
boolean
|
true if the specified string starts with the given substring.
false if the specified string does not start with the given substring.
|
Example
if s.startsWith( "exit" )
break
end
|