次の問題を実現する方法を探しています。
String a から始めて String[] equals を返そうとします
new String[]{Q},{ec.Qh},{ec.Q2}
誰にも提案はありますか?
ここのところ:
String a="Q={{ec.Qh}{ec.Q2}}";
int index_first = a.indexOf("=");
String name= a.substring(0,index_first);
String temp=a.substring(index_first+1, a.length());
temp=temp.replaceAll("\\{\\{","");
temp=temp.replaceAll("\\}\\{","\\,");
temp=temp.replaceAll("\\}\\}","");
String[] synonyms=temp.split(",");
//for(int i =0;i<synonyms.length;i++){System.out.println(synonyms[i]);}
String[] result=new String[]{name,synonyms} // does not work!