I have the following problem: I have such an array of strings that
String[] myArray = {"AAAA","BBBB","CCCC"};
and my goal is to create another such array
String myNewArray = {"\uAAAA","\uBBBB","\uCCCC"};
The problem is that if I try to create an array using a loop
for (int i=0; i<myArray.length; i++) { myNewArray[i] = "\u" + myArray[i]; }
I get "Unacceptable Unicode Error" if I use such a loop
for (int i=0; i<myArray.length; i++) { myNewArray[i] = "\\u" + myArray[i]; }
I get this array
String myNewArray = {"\\uAAAA","\\uBBBB","\\uCCCC"};
And if I use this loop
for (int i=0; i<myArray.length; i++) { myNewArray[i] = "\\u" + myArray[i]; myNewArray[i] = myNewArray[i].substring(1); }
I get this array
String myNewArray = {"uAAAA","uBBBB","uCCCC"};
Does anyone know how I can do this?
thanks
source share