I want to remove square brackets from a string, but I don\'t know how.
String str = \"[Chrissman-@1]\"; str = replaceAll(\"\\\\[\\\\]\", \"\"); String[] tem
Your regex matches (and removes) only subsequent square brackets. Use this instead:
str = str.replaceAll("\\[|\\]", "");
If you only want to replace bracket pairs with content in between, you could use this:
str = str.replaceAll("\\[(.*?)\\]", "$1");