Check what a string in a config says

Discussion in 'Plugin Development' started by legostarwarszach, May 11, 2013.

Thread Status:
Not open for further replies.
  1. I want to see what a string in a config says. How would I do this?
    Thanks in advance
     
  2. Offline

    Compressions

  3. But how could I compare it? Should I do it in a IF Statement of what?

    Does anyone know?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 1, 2016
  4. Offline

    MistPhizzle Retired Staff

    Code:
    String1 = plugin.getConfig().getString("path.toString");
    String2 = plugin.getConfig().getString("path.toString2");
     
    if (String1.equals(String2) {
    // Execute Code if the two strings are equal.
    }
     
    if (String1.contains(Object) {
    // Execute Code if String1 contains an object.
    }

    You can do it like that. After you type your string, hit a . and look at what comes up.
     
Thread Status:
Not open for further replies.

Share This Page