Anti Swear strings

Discussion in 'Plugin Development' started by aninsanellama, Sep 9, 2013.

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



    I'm pretty new to Bukkit development, and I have a question about an anti-swear system. I'm not sure if there is a way, or not, so I'll look like an idiot if there is, and this is a pretty simple question.

    Very simply, I'm creating a String variable and making it equal to a word I don't want to be displayed. The problem is, if a string is like this: "string", then it wouldn't work for "String", it'd save me a lot of time and effort if there was a way to get Java to check it as capitals as well as lower-case.

  2. Offline


    "string".equalsIgnoreCase("StRiNg") == true
  3. Offline


    How would that be applied into the code?

    For example, I want to check: "if(message.contains(swear1)", and the string is like: 'String swear1 = "string";', what would I change?
  4. Offline


    Your post will be true :D
  5. Offline


  6. or you could loop through a list, i would suggest that. or a config file if you want to store them there
  7. Offline


  8. Offline


    Thanks, I've solved it now.
  9. Offline


    Glad to hear that. Please mark this thread as [Solved].
Thread Status:
Not open for further replies.

Share This Page