You can, but it is a bit tricky.
First you set your "bad words" array in the following way.
_bad_words_strings = ["hello", "bye"];
bad_words_array = [];
{
_temp_array = to_array _x;
bad_words_array = bad_words_array + [_temp_array];
} forEach _bad_words_strings;
Then, once you have a string in an editbox of anywhere else you need to split it into words, for example, looking for spaces:
_word = [];
// _string has your edit control string.
_full_array = to_array _string;
for [{_i=0},{_i<count _full_array},{_i=_i+1}] do
{
// This quite basic example uses 32 (space) as indication that a word is finished.
if (_x != 32) then
{
_word = _word + [_full_array select _i];
}
else
{
if (_word in bad_words_array) then
{
hint "BAD WORD DETECTED";
};
_word = [];
};
};
if (count _word > 0) then
{
if (_word in bad_words_array) then
{
hint "BAD WORD DETECTED";
};
};