Web features explorer

String startsWith() and endsWith()

Widely available since 2018-03-30
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.

Learning resources on MDN

Browser support

Specifications