in java im trying to use string.replaceall to replace "+" and "-" with " + " and " - "
However str.replaceall("+"," + ") results in an error,
so I tried str.replaceall("\+"," + ") and str.replaceall("\Q+\E"," + ")
neither worked
after that i tried str.replaceall("\+"," + ") but forgot to mention it originally, but it does not affect my strings which contain "1x^5+2x^4+6x^3+3x^2+4x^0"
Final answer =
str = str.replaceAll("\\+"," + ");
str = str.replaceAll("\\-", " - ");