1. Đếm số ký tự có trong chuổi: var str="str1,str2,str3,str4"; var len=(str.match(/,/g) || []).length; alert(len);