JavaScript program to check if a string starts and ends with certain characters:

python tutorials and learn python

Created with Sketch.

JavaScript program to check if a string starts and ends with certain characters:

let str = "Hello World!";
let startsWith = "Hello";
let endsWith = "!";

console.log(str.startsWith(startsWith));
console.log(str.endsWith(endsWith));

Leave a Reply

Your email address will not be published. Required fields are marked *