Код: Выделить всё
process_str(StringBuilder copy, List idxList) {
for(int i = 0; i < idxList.size(); ++i) {
int pos = idxList.get(i);
copy.setCharAt(pos, '$');
}
StringBuilder output = new StringBuilder();
for(int i = 0; i < copy.length(); ++i) {
char ch = copy.charAt(i);
if(ch != '$')
output.append(ch);
}
return output.toString();
}
Есть ли более простой способ сделать это?
Подробнее здесь: https://stackoverflow.com/questions/718 ... -stringbui