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

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?
Reply
#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
#3

Thank you dear Kyance.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)