same topic : replace String with another in java
I want to replace String Replace = "SUM(NewCounter)+SUM(NewCounter2)+NewCounter3";
I have Array A = {NewCounter, NewCounter2, NewCounter3}
say I have Array B = {test, testA, testB}
I want to replace it with array A
with array B
in String Replace
.
I try to use method ReplaceAll(A.get(index), B.get(index));
Problem is:
NewCounter2
is Read by system "NewCounter"+2
so I have result = String Replace = "SUM(test)+SUM(test2)+test3";
I try to use ' in Character NewCounter, it will be Array A = {'NewCounter', 'NewCounter2', 'NewCounter3'}
but I must change String Replace
Before like this :
String Replace = "SUM('NewCounter')+SUM('NewCounter2')+'NewCounter3'";
Is there other way to me ??? I don't want to change String before...
Thanksfull,
-mazipan-