How to use startsWith method ignoring the case in Node.js

1 Answer

0 votes
const str = "node.js php c c++";

const substr = 'NODE';

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

 



answered Jul 12, 2022 by avibootz

Related questions

1 answer 133 views
1 answer 156 views
1 answer 140 views
1 answer 125 views
1 answer 128 views
2 answers 184 views
1 answer 134 views
...