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; } }

JavaScript 判断字符串是否以 'C00' 开头且长度为 9 (兼容旧版 IE)

原文地址: https://www.cveoy.top/t/topic/oep4 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录