How to case insensitive check if string contains specific character in JavaScript

1 Answer

0 votes
const str = 'javascript c c++';
const ch = 'A';

console.log(str.toLowerCase().includes(ch.toLowerCase()));
console.log(str.includes('A')); 




/*
run:

true
false

*/

 



answered Feb 6, 2022 by avibootz
...