-3

I am trying to use Java replaceAll()but Intellij tells me that the result is being ignored.

enter image description here

I am aware Strings are immutable but from what I can tell I am using it correctly. Is there a more proper was to utilize this String method?

For clearly I will post the code in the picture below and sbis a StringBuilder

 String insert = sb.toString();
                insert.replaceAll("(\\(['0-9,]*\\',)",TABLE_NAME+"_seq.nextval,");
                writer.write(insert); 
General Grievance
  • 4,555
  • 31
  • 31
  • 45
Mike3355
  • 11,305
  • 24
  • 96
  • 184
  • 3
    *"I am aware Strings are immutable"* - Yet you write code that assumes it would be mutable. Maybe you should reread what immutable means to strings and the string-manipulation methods. – Zabuzard Jul 02 '18 at 16:36

1 Answers1

2

You need to assign to result of replaceAll to something: String something = str.replaceAll()

Sam Orozco
  • 1,258
  • 1
  • 13
  • 27