AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved AMXX Need some help (https://forums.alliedmods.net/showthread.php?t=307527)

D4rkSiD3Rs 05-13-2018 20:23

AMXX Need some help
 
Hello,

How can i calculate the number of digits in a string whatever if it contains letters or digits ?
I tried to use strlen and isdigit but isdigit works only if the string contains only digits.

instinctpt1 05-13-2018 22:35

Re: AMXX Need some help
 
PHP Code:


CountNumbers
( const String[] )
{
    new 
Count;
    new 
Len strlen( String );
    
    for ( new 
Leni++ )
    {
        if ( 
isdigitString] ) )  { Count++; }
    }
    
    return 
Count;




All times are GMT -4. The time now is 04:37.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.