"startsWith" (string::startsWith)
Returns true if the string starts with s, otherwise false.
Synopsis
bool string.startsWith(string s, CaseSensitivity cs =
CaseSensitive);
Parameters
| Parameter | Description |
|---|---|
| s | String to compare. |
| cs |
Decides if the search is case sensitive. Can be either:
|
Description
Returns true if the string starts with s, otherwise false.
Example
main()
{
string tag = "AlarmHigh";
DebugN(tag.startsWith("alarm", string::CaseSensitive));
DebugN(tag.startsWith("alarm", string::CaseInsensitive));
}
Console output:
WCCOAui1:["0"]
WCCOAui1:["1"]
Assignment
String
