Using String.startsWith and String.endsWith in Javascript


Check if a string starts or ends with a specific substring.

Source Code

let text = 'Hello, world!';
console.log(text.startsWith('Hello'), text.endsWith('world!'));
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments