Solved .replace not work with a string

Discussion in 'Spigot Plugin Development' started by --TOMAS--, May 29, 2016.

  1. SOLVED
     
    #1 --TOMAS--, May 29, 2016
    Last edited: May 29, 2016
  2. Everything you did is so wrong.
    1) Why are you naming your variables in caps
    2) Dont compare a Boolean with a Boolean to get a Boolean
    3) Your brackets are messed up when you are using the replace
    4) Don't use replaceAll, use replace. ReplaceAll is for regex's. Replace automatically replaces all of them.
    5) Did you even look at your code?
    6) Do you even know Java?
     
  3. Thanks :)
     
    1. because he can. It isn't considered bad practice. For example, the variable MAX_VALUE or MIN_VALUE in Integer is all caps? So can CLIENT_ID, MOD_ID or ID also be. Of course you don't always want to have your variables all caps, but I'd say it's completely fine for IP.
    2. Correct point. It's considered bad practice.
    3. @--TOMAS-- , you are replacing %ip% (etc...) in the player's name. Fix your brackets!
    4. Isn't he using replace? He hasn't edited it after you said it. (EDIT: ah, nvm, he's using replaceAll once).
    5. He probably did, but doesn't know what Rubber duck debugging is.
    6. Probably not. Which is why we should supply him with the following link(s): http://www.tutorialspoint.com/java/ , https://docs.oracle.com/javase/7/docs/api/
     
  4. Check his profile. The last 2 were meant to be jokes but failed miserably. I wasn't trying to be rude ._.
     
  5. I guess it has been rude for just ask something easy? It will be easy but I do not know :/
     
  6. These name conventions are for constants, not for variables, what he is declaring is a variable. It is a bad practice.
     
  7. Lel :p I've switched to an imaginary duck though, people started to talk.
     
    • Winner Winner x 1