[Solved] Check if string has bad words and return true/false.

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

User avatar
meanvel
Posts: 129
Joined: 19 Jan 2017, 14:06

[Solved] Check if string has bad words and return true/false.

Postby meanvel » 06 Mar 2017, 02:46

Update: Figured it out...

Code: Select all

        String stringToFilter = "oh hell no";
        int numBadWords = getParentZone().getWordFilter().apply(stringToFilter).getOccurrences();
        if (numBadWords > 0){
//Bad words
} else {
//No bad words
}

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 69 guests