JavaScript String startsWith()
JavaScript String startsWith()
The startsWith() method is used to return true if a string starts with a specified string else it will return false. This method is case-sensitive.
Syntax:-
Its syntax is:- string.startsWith(searchValue, start)
Return:-
Its return is:- true if the string starts with the value else false
Further Explanation:-
Parameter | Description |
searchValue | Required. The string to search for. |
start | Optional. Start position. |