Web features explorer

String startsWith() and endsWith()

Widely available
Tags: javascript Groups: JavaScript > Primitive types > Strings

The startsWith() and endsWith() methods of strings returns whether a search string appears at the beginning or end of the provided string. To learn more, see String.prototype.endsWith(), String.prototype.startsWith() at MDN.

Compatibility

Specifications