AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Check if string is alphanumeric only (https://forums.alliedmods.net/showthread.php?t=155503)

zeus 04-23-2011 03:24

Check if string is alphanumeric only
 
Is there a better way to verify than this ?
PHP Code:

if( containiszName"`" ) != -|| containiszName"~" ) != -blabla 


ConnorMcLeod 04-23-2011 03:44

Re: Check if string is alphanumeric only
 
is_str_alpha( szName )

PHP Code:

is_str_alpha( const szString[] )
{
    new 
cChariPos
    
while( cChar szString[iPos++] )
    {
        if( !
isalpha(cChar) )
        {
            return 
false
        
}
    }
    return 
true




All times are GMT -4. The time now is 20:10.

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