XJS: extract string within a string
Posted on 2014-12-04
I have the following variable
var Text = nodeRQ.ValueOfSelect("Text");
A/ONE/TWO/MAIN TEST EXTRA/2//15D/738-738//1488/2/USD/TAX/112/US/1600///ADT/NNN//ZA/1//T/ZZ/ZZ///01
how do i change this such that it reads as follows. where i removed 738-738
A/ONE/TWO/MAIN TEST EXTRA/2//15D///1488/2/USD/TAX/112/US/1600///ADT/NNN//ZA/1//T/ZZ/ZZ///01
so remove the contents between the 7th "/" and 8th "/" ?
Basically, using indexOf to find 7th "/" and 8th "/" then concatenate the remaining strings?