From 4b1769f457fdf0a6239c35bbf82f365b95c1498f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 15 Sep 2005 17:53:02 +0000 Subject: [PATCH] Added feature request at18988 --- plugins/include/string.inc | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/plugins/include/string.inc b/plugins/include/string.inc index feacf0df..f9955dd2 100755 --- a/plugins/include/string.inc +++ b/plugins/include/string.inc @@ -125,4 +125,17 @@ native strcat(dest[], const source[], maxlength); native strfind(const string[], const sub[], ignorecase=0, pos=0); /* Compares two strings with the C function strcmp(). Returns 0 on equal. */ -native strcmp(const string1[], const string2[], ignorecase=0); \ No newline at end of file +native strcmp(const string1[], const string2[], ignorecase=0); + +// tests if given string contains only digits +stock bool:is_str_num(sString[]) +{ + new i = 0, len = strlen(sString); + + do + { + if (!isdigit(sString[i])) + return false; + } while (i++ < len); + return true; +} \ No newline at end of file