Solved somestring.length()

Discussion in 'Plugin Development' started by cdnyassuo34, Aug 25, 2019.

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

    cdnyassuo34

    Hi, I am creating an animated scoreboard plugin and I am trying to get the size of a string with this…
    public String Information = "Something that will be write on the scoreboard and will move to fit in the scoreboard"
    ...
    int infosize = Information.length() - 16;
    but eclipse is telling me that it's wrong, why ?

    thanks for anyone who will answer this question ^-^
     
  2. Offline

    wand555

    What type of error are you getting?
     
  3. Offline

    KarimAKL

    @cdnyassuo34 I think it might be a warning because the field name isn't following Java naming conventions.
     
  4. In my opinion, the only two things that could be wrong are either the missing semicolon or you put the String declaration into a method (where the public modifier isn't allowed). Eclipse describes the error when hovering over the wrong places so as mentioned, read this message and post it if you don't understand it
     
  5. Offline

    cdnyassuo34

    So it's not wrong?
     
  6. Offline

    CraftCreeper6

  7. Offline

    KarimAKL

    @cdnyassuo34 Tell us what Eclipse says. (When you hover over the underlined text)
     
  8. Offline

    cdnyassuo34

    You mean the small message under the error? If yes it is '' remove ''
     
  9. Offline

    CraftCreeper6

    @cdnyassuo34
    Could you please screenshot the error and the line of code.
     
  10. Offline

    cdnyassuo34

    oh sorry ^^ the error was an actual error with eclipse... just had to restart eclipse and the error wasn't appearing anymore
     
Thread Status:
Not open for further replies.

Share This Page