The solution with best performance is to build a new string and copy every character you want. This requires a for loop and two counter variables. One for the source string and one for the target string.
Not tested:
PHP Code:
new String:cleanedMessage[sizeof(message)+1];
new pos_cleanedMessage = 0;
for (new i = 0; i < sizeof(message); i++) {
if (IsCharAlpha(message[i]) || IsCharNumeric(message[i])) {
cleanedMessage[pos_cleanedMessage++] = message[i];
}
}
// Terminate the string with 0
cleanedMessage[pos_cleanedMessage] = '\0';
__________________