Solved .replace

Discussion in 'Plugin Development' started by Derugo, Aug 19, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Derugo

    I'm getting this error: 'The method replace(char, char) in the type String is not applicable for the arguments (String, int)' for this code:

    [​IMG]

    Anyone able to help with this?
    Thanks in advance.
     
  2. add String.valueOf() around Bukkit.getOnlinePlayers().size(); (so: String.valueOf(Bukkit.getOnlinePlayers().size());)
     
    Derugo likes this.
  3. Offline

    Hoolean

    Derugo

    The replace method is used for replacing all characters in a String with another character. You want replaceAll (for replacing all occurrences of a String in a String with another String) or replaceFirst (for doing the same but just with the first occurrence). You probably want replaceAll. :)

    edit: also what Datdenkikniet said (ninja'd)
     
  4. Offline

    Derugo

Thread Status:
Not open for further replies.

Share This Page