Languages
[Edit]
EN

JavaScript - check if string starts with

0 points
Created by:
Evania
314

In this article, we would like to show you how to check if string starts with in JavaScript.

Quick solution:

// ONLINE-RUNNER:browser;

const text = 'Example text...';

const result = text.startsWith('Example');

console.log(result);  // true

References

  1. String.prototype.startsWith() - JavaScript | MDN
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join