var temp = "/User/Create";
alert(temp.count("/")); //should output '2' find '/'
私はこのようにしてみます
// the g in the regular expression says to search the whole string
// rather than just find the first occurrence
// if u found User -> var count = temp.match(/User/g);
// But i find '/' char from string
var count = temp.match(///g);
alert(count.length);
ここで試すことができますhttp://jsfiddle.net/pw7Mb/