I have twos strings, one holds a valid ip address and the other its subnet mask.
I need the network address ( AND of the two). How can I check that the subnet mask is valid ( all 1's followed by all 0's) and get the network number?
"126.96.36.199" as string (network address)
To validate the subnet mask I can arithematically examine each bit in each component and use a flag to check if its all 1's followed by all 0. Is there an easier way? I am a little lost on how perform the bit wise AND operation on these.