var s="jhdoiweesdds";var n=(s.split(‘s‘)).length-1;document.write(n);
查找字符串中元素出现的次数
原文:http://www.cnblogs.com/xphdy/p/6295235.html