var str = "Hello Lewes";
var ch = 'e';
var count = str.split("e").length - 1;
console.log(count);
/*
Output: 3
*/
const string = "Hello world"
const charCount = string.length //11
const charCountWithoutWhitespace = string.replace(/s/g, '').length //10
const wordCount = string.split(/s+/).length //2
const paragraphCount = string.replace(/
$/gm, '').split(/
/).length //1