Check if string contains an IP address
#6

try this....Credits aren't mine tho.


pawn Code:
stock detectIP(text[])
{
    new dotCount;
    for(new i; i < strlen(text); ++i)
    {
        if('0' <= text[i] <= '9')
        {
            do
            {
                if(text[i] == '.') ++dotCount;
                ++i;
            }
            while(('0' <= text[i] <= '9') || text[i] == '.' || text[i] == ':');
        }
    }
    if(dotCount >= 3) return true;
    return false;
}
Reply


Messages In This Thread
Check if string contains an IP address - by beckzy - 06.09.2014, 18:07
Re: Check if string contains an IP address - by Evocator - 06.09.2014, 18:52
Re: Check if string contains an IP address - by beckzy - 06.09.2014, 19:04
Re: Check if string contains an IP address - by Stinged - 06.09.2014, 19:55
Re: Check if string contains an IP address - by beckzy - 06.09.2014, 20:46
Re: Check if string contains an IP address - by silenthill - 06.09.2014, 21:15
Re: Check if string contains an IP address - by beckzy - 06.09.2014, 21:46
Re: Check if string contains an IP address - by Isolated - 06.09.2014, 21:53
Re: Check if string contains an IP address - by Vince - 06.09.2014, 22:02
Re: Check if string contains an IP address - by beckzy - 06.09.2014, 22:07

Forum Jump:


Users browsing this thread: 1 Guest(s)