How to get the substring after specific character in Node.js

1 Answer

0 votes
const str = 'javascript c++ c typescript node.js';
 
const ch = 'y'
 
const subs = str.substring(str.indexOf(ch) + 1);
 
console.log(subs);
 
   
   
   
   
/*
run:
   
pescript node.js
   
*/

 



answered Feb 18, 2022 by avibootz

Related questions

...