1<html>
2<body>
3 <script>
4 function countWords(str) {
5 str = str.replace(/(^\s*)|(\s*$)/gi,"");
6 str = str.replace(/[ ]{2,}/gi," ");
7 str = str.replace(/\n /,"\n");
8 return str.split(' ').length;
9 }
10 document.write(countWords(" Tutorix is one of the best E-learning platforms"));
11 </script>
12</body>
13</html>
1<html>
2<body>
3<script>
4 function countWords(str) {
5 str = str.replace(/(^\s*)|(\s*$)/gi,"");
6 str = str.replace(/[ ]{2,}/gi," ");
7 str = str.replace(/\n /,"\n");
8 return str.split(' ').length;
9 }
10document.write(countWords(" Tutorix is one of the best E-learning platforms"));
11</script>
12</body>
13</html>