what I want to do is I want to remove "[
" "]
" from a string for this I tried to Iterate over characters of a String make an ArrayList of Characters and then convert the ArrayList back to a string but know I don't know how to convert the ArrayList of characters into a string
String text="Hell[o Worl]d!"
ArrayList<Character> filtredChars = new ArrayList<Character>();
CharacterIterator it = new StringCharacterIterator(text);
while(it.current() != CharacterIterator.DONE)
{
if (it.current() != '[' && it.current() != ']')
filtredChars.add(it.current());
it.next();
}
is it possible or is there another solution ?