diff --git a/amxmodx/string.cpp b/amxmodx/string.cpp index 4cbe6258..e7ca4c09 100755 --- a/amxmodx/string.cpp +++ b/amxmodx/string.cpp @@ -571,6 +571,43 @@ static cell AMX_NATIVE_CALL is_alpha(AMX *amx, cell *params) return isalpha( params[1] ); } +static cell AMX_NATIVE_CALL amx_trim(AMX *amx, cell *params) +{ + int len; + char *asdf = get_amxstring(amx, params[1], 0, len); + int flag = 0, incr = 0; + register int i = 0; + for (i=strlen(asdf); i>=0; i--) + { + if (!isspace(asdf[i])) + { + break; + } else { + asdf[i] = 0; + } + } + + len = strlen(asdf); + + for (i=0; i