How to check if a string starts with another string from specific index in JavaScript

1 Answer

0 votes
const s = "javascript php c++ c";
  
if (s.startsWith("php", 11))
    console.log("yes");
else
    console.log("no");
 



    
/*
run:
     
"yes"
     
*/

 



answered Jun 23, 2021 by avibootz
...