Answers for "c# ipaddress tryparse int"

C#
0

c# ipaddress tryparse int

public bool ValidateIPv4(string ipString)
{
    if (String.IsNullOrWhiteSpace(ipString))
    {
        return false;
    }

    string[] splitValues = ipString.Split('.');
    if (splitValues.Length != 4)
    {
        return false;
    }

    byte tempForParsing;

    return splitValues.All(r => byte.TryParse(r, out tempForParsing));
}
Posted by: Guest on November-26-2020

C# Answers by Framework

Browse Popular Code Answers by Language