An ASP page gets the following querystring:
iID1=73, 0, 0, 320, 402, 733
Based on this querystring, records are displayed from a database table to the users. Suppose a user clicks the record whose ID1=73. Then the page gets another querystring ID2=73 i.e.
iID2=73
The value of ID1 remains the same. Now I want to replace 73 (& not the 73 in 733) with 0. I am using the following Replace function to replace 73 with 0:
iIDs=Replace(iID1,iID2,"0"
But what is happening is both 73 & the 73 in 733 gets replaced with zero i.e. the querystring becomes
iID1=0, 0, 0, 320, 402, 03
Note that 733 has been replaced by 03 at the very end of the querystring since it substitutes the 73 in 733 also with a zero. But I want that it should be
iID1=0, 0, 0, 320, 402, 733
How do I ensure that only 73 gets replaced with zero & the 73 in 733 remains as it is? Please note that ID1 can be in any order. For e.g. it can be
iID1=733, 0, 0, 320, 402, 73
or
iID1=0, 733, 0, 73, 402, 320
or
iID1=320, 0, 73, 402, 733, 0
or
iID1=0, 0, 320, 73, 733, 402
Thanks,
Arpan
iID1=73, 0, 0, 320, 402, 733
Based on this querystring, records are displayed from a database table to the users. Suppose a user clicks the record whose ID1=73. Then the page gets another querystring ID2=73 i.e.
iID2=73
The value of ID1 remains the same. Now I want to replace 73 (& not the 73 in 733) with 0. I am using the following Replace function to replace 73 with 0:
iIDs=Replace(iID1,iID2,"0"
But what is happening is both 73 & the 73 in 733 gets replaced with zero i.e. the querystring becomes
iID1=0, 0, 0, 320, 402, 03
Note that 733 has been replaced by 03 at the very end of the querystring since it substitutes the 73 in 733 also with a zero. But I want that it should be
iID1=0, 0, 0, 320, 402, 733
How do I ensure that only 73 gets replaced with zero & the 73 in 733 remains as it is? Please note that ID1 can be in any order. For e.g. it can be
iID1=733, 0, 0, 320, 402, 73
or
iID1=0, 733, 0, 73, 402, 320
or
iID1=320, 0, 73, 402, 733, 0
or
iID1=0, 0, 320, 73, 733, 402
Thanks,
Arpan