How to get the substring after specific character in JavaScript

1 Answer

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

const ch = '+'

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

console.log(subs);

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

 



answered Feb 18, 2022 by avibootz

Related questions

1 answer 128 views
1 answer 120 views
1 answer 117 views
1 answer 132 views
1 answer 136 views
1 answer 144 views
1 answer 140 views
...