javascript 判定字符串是C00開頭長度為9。兼容舊版的IE
function checkString(str) { if (str.substring(0, 3) === "C00" && str.length === 9) { return true; } else { return false; } }
// 兼容舊版的IE function checkStringIE(str) { if (str.slice(0, 3) === "C00" && str.length === 9) { return true; } else { return false; } }
原文地址: https://www.cveoy.top/t/topic/fpjx 著作权归作者所有。请勿转载和采集!