Replace with curly bracket?

Discussion in 'Plugin Development' started by thebigdolphin1, Apr 5, 2013.

Thread Status:
Not open for further replies.
  1. heres my code:
    Code:
    line1.replaceAll("\\{HELLO\\}", "SOMETHING");
    It just keeps it as it is, '{HELLO}'
     
  2. try line1.replaceAll(Pattern.quote("{HELLO}"), "SOMETHING");
    incase the methode you uses uses regex
    try line1.replaceAll("{HELLO}", "SOMETHING");
    incase the methode it dont uses
    (I dont know for sure if string.replaceAll uses regex, just test by your own)
     
  3. Well im not sure.
    It doesnt work like that either. :(
     
  4. Offline

    Superkabii

    We need more code to see what's wrong, from your snippet alone it should work.

    I have a feeling you're trying to use String as if it's mutable, remember replaceAll does not modify the String itself but rather returns a modified object.
     
  5. Yeah, that was the problem.
    XD
     
Thread Status:
Not open for further replies.

Share This Page