How to find the String Count in a String in JavaScript?
Ex:
https://localhost/public/10e900fe-0470-11eb-93c6-f377ab03a336//
Get the // occurrence count.
var a="https://localhost/public/10e900fe-0470-11eb-93c6-f377ab03a336//"
var count= a.split("//").length-1;
console.log(count)
you can find the count by splitting it into an array and find the length of the array
var a="https://localhost/public/10e900fe-0470-11eb-93c6-f377ab03a336//"
var count= a.split("//").length-1; // its 2