after looking further this is a better way to go converts to array finds item and removes it then converts back to multiline string
Macro Example String Replacement
Macro Example String Replacement
;;;simulates the info received from webpage
str accountList = "account1[]account2[]account3[]account4[]account5"
str getAccount = "account5"
ARRAY(str) arr
int i nt
nt = tok(accountList arr)
for(i 0 nt)
,if arr[i]= getAccount
,,int rs=i
arr.remove(rs)
accountList=arr
accountList.trim
out accountList