Checking characters in string
#9

Wow Konstantinos, you are saving me again yesterday you typed working code too.. Is possible to put this character check function to stock, which you sent me yesterday? Thanx mate

pawn Код:
NameCheck (const sz_Name[])
{
    new
        lenght = strlen(sz_Name);

    if (!lenght) return 0;

    new
        us_count,
        sp_count,
        pos = strfind(sz_Name, "_", true);

    for (new i; i != lenght; ++i)
    {
        if (sz_Name[i] == '_') ++us_count;
        if (sz_Name[i] == ' ') ++sp_count;
    }
   

    return (lenght <= 19 && sz_Name[0] >= 'A' && sz_Name [0] <= 'Z' && sz_Name [pos+1] >= 'A' && sz_Name [pos+1] <= 'Z' && us_count == 1 && sp_count == 0);
}
Reply


Messages In This Thread
Checking characters in string - by Riwerry - 29.01.2014, 13:45
Re: Checking characters in string - by Wizz123 - 29.01.2014, 13:53
Re: Checking characters in string - by Riwerry - 29.01.2014, 14:09
Re: Checking characters in string - by Wizz123 - 29.01.2014, 14:24
Re: Checking characters in string - by Riwerry - 29.01.2014, 14:32
Re: Checking characters in string - by Wizz123 - 29.01.2014, 14:34
Re: Checking characters in string - by Riwerry - 29.01.2014, 14:39
Re: Checking characters in string - by Konstantinos - 29.01.2014, 14:52
Re: Checking characters in string - by Riwerry - 29.01.2014, 14:54
Re: Checking characters in string - by Konstantinos - 29.01.2014, 15:10

Forum Jump:


Users browsing this thread: 1 Guest(s)