Set string in config adds apostrophes around value ?

Discussion in 'Plugin Development' started by ThunderWaffeMC, Jul 20, 2014.

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

    ThunderWaffeMC

    Hi. When setting a string in a config with getConfig().set("path", "value"); it always adds apostrophes around the value. For example:

    If I run this code on plugin enable:

    Code:java
    1.  
    2. if(!getConfig().contains("Path")) {
    3. getConfig().set("Path", "value");
    4. }
    5.  


    It will return as:

    Code:
    Path: 'value'
    When all I want is:

    Code:
    Path: value
    The path's value will then return as null if it has the apostrophes. Hopefully there's a quick fix, thanks!
     
  2. Offline

    fireblast709

  3. Offline

    theguynextdoor

    Your 'value' is a string. This is how YML files store strings
     
  4. Offline

    To175

  5. Offline

    Skionz

    Is there an issue with it? I don't really think it matters too much as long as it works.
     
  6. Offline

    To175

    Skionz thanks, I have

    instead of
     
Thread Status:
Not open for further replies.

Share This Page