String.prototype.len=function(){return this.replace([^\x00-\xff]/g,"aa").length;}
你的要求的字符串是什么? 纯数字还是字符?如下示例说明了怎么在str中找出,号的数量 var str = "aaa,bb,cc,dd,ee,sa1,ewe";Regex regex = new Regex(@"(\,)");int count = regex.Matches(str).Count;