How to use endsWith method ignoring the case in TypeScript

1 Answer

0 votes
const str = "typescript php c c++ python";

const substr = 'PYTHON';

console.log(str.toLowerCase().endsWith(substr.toLowerCase()));
    
    
    
    
/*
run:
    
true
    
*/

 



answered Jul 12, 2022 by avibootz
...