How to find the index of the last space in string with TypeScript

1 Answer

0 votes
const str = "javascript php c typescript node.js c++ c#";
  
const last_index = str.lastIndexOf(' ');
   
console.log(last_index);
    
       
        
        
/*
run:
        
39
        
*/

 



answered Feb 17, 2022 by avibootz

Related questions

1 answer 87 views
1 answer 92 views
1 answer 89 views
1 answer 79 views
1 answer 88 views
...