方式一、输入项与被匹配项全部转化成统一格式
toUpperCase():把字符串转换为大写;
toLowerCase() :把字符串转换为小写。
实战代码
let titleName: boolean = title.toLowerCase().includes(name.split('-')[0].toLowerCase());
方式二、js正则进行忽略大小写匹配
利用正则 i
let word = /abc/i
console.log(word.test('ABC')