How to get the substring after specific character in TypeScript

1 Answer

0 votes
const str = 'javascript c++ c typescript node.js';

const ch = 't'

const subs = str.substring(str.indexOf(ch) + 1);

console.log(subs);

  
  
  
  
/*
run:
  
" c++ c typescript node.js" 
  
*/

 



answered Feb 18, 2022 by avibootz

Related questions

1 answer 104 views
1 answer 247 views
1 answer 112 views
1 answer 110 views
1 answer 102 views
1 answer 120 views
1 answer 152 views
...