startsWithIgnoreCase (JavaScript)
Checks whether a string starts with a substring ignoring case.
Defined in
String (Standard - JavaScript)Syntax
startsWithIgnoreCase(str:string) : boolean
Parameters | Description |
---|---|
str |
The substring. |
Return value | Description |
---|---|
boolean |
True if this string starts with the substring, or the substring is empty. |
Examples
The following example compares the start of a string against a substring ignoring case. This comparison is true.var cities = new String("Paris Moscow Tokyo");
if (cities.startsWithIgnoreCase("paris"))
return "Starts with Paris";
else
return "Does not start with Paris"