Is it possible to allow only letters/numbers?
#2

Quote:
Originally Posted by LocMax
Посмотреть сообщение
So, I need some kind of function which would forbid usage of any symbols or so, so basically only numbers and letters can be used.
How can I do it? like do I need to list all symbols or?
pawn Код:
stock IsValidPassword( const password[ ] )
{
    for( new i = 0; password[ i ] != EOS; ++i )
    {
        switch( password[ i ] )
        {
            case '0'..'9', 'A'..'Z', 'a'..'z': continue;
            default: return 0;
        }
    }
    return 1;
}
I don't remember from who I got this, but yeah.. not made by me xd
Reply


Messages In This Thread
Is it possible to allow only letters/numbers? - by LocMax - 03.12.2014, 16:17
Re: Is it possible to allow only letters/numbers? - by Kyance - 03.12.2014, 16:24
Respuesta: Is it possible to allow only letters/numbers? - by LocMax - 03.12.2014, 16:40

Forum Jump:


Users browsing this thread: 1 Guest(s)