Getting a list of KEYS without it inside []

Discussion in 'Plugin Development' started by GeekyCompz, Oct 18, 2013.

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

    GeekyCompz

    The title explains it all. I need to get a LIST of the KEYS without it being inside any of those [].
    Now I achieved this, although this disables the player from putting any name with those brackets in them. So I only want to replace the first and last one.

    Code So Far. But replaces all of those characters.
    Code:
    String allProblems = problemsyml.getConfigurationSection("Problems").getKeys(false).toString().replace("[", "").replace("]", "");
    ~Geeky
     
  2. Offline

    travja

    Just trim the string
     
  3. Offline

    GeekyCompz

    I did, but it still has the [] at the end and beginning...
     
  4. .getKeys(false) returns a set of keys that you could use, just look over the collection as normally to get al the separate keys
     
Thread Status:
Not open for further replies.

Share This Page