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

1 Answer

0 votes
const str = 'typescript c c++';
const ch = 'T';

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




/*
run:

true
false

*/

 



answered Feb 6, 2022 by avibootz
...