Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to replace string using JS ?  RSS feed

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to replace string using JS ?

for example,
var d="iss.classArr[0].components[0].c[1].data";
d.replace("c[1]", "c[0]"); // fail

I try to replace index of c. I want to get "iss.classArr[0].components[0].c[0].data".

Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66144
143
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the APi for the String class?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!