From e78e6d9879e4494c69de8485b8228e01ae7d2515 Mon Sep 17 00:00:00 2001 From: qianguyihao Date: Thu, 18 Mar 2021 20:10:43 +0800 Subject: [PATCH] update --- 04-JavaScript基础/13-内置对象 String:字符串的常见方法.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/04-JavaScript基础/13-内置对象 String:字符串的常见方法.md b/04-JavaScript基础/13-内置对象 String:字符串的常见方法.md index f8234bd..1d8e9b2 100644 --- a/04-JavaScript基础/13-内置对象 String:字符串的常见方法.md +++ b/04-JavaScript基础/13-内置对象 String:字符串的常见方法.md @@ -154,9 +154,11 @@ console.log('a 出现的次数是: ' + num); const name = 'qianguyihao'; console.log(name.search('yi')); // 打印结果:6 -console.log(name.search(/\yi/i)); // 打印结果:6 +console.log(name.search(/yi/i)); // 打印结果:6 ``` +备注:上方的`/yi/i`采用的是正则表达式的写法,意思是,让 name去匹配字符`yi`,忽略大小写。 + ### 3、includes():字符串中是否包含指定的内容