A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
IP Address format
Joined: Jan 27, 2004
Dec 02, 2004 09:07:00
I have to check for the valid IP Address that is being entered by the user before the IP Address is used for querying the database.
Here are the rules:
if someone enters leading zeroes, for example 192.051 or 192.051.088 the leading zero would be stripped ip address used will be 192.51 or 192.51.88
IP Address should have periods at right places
are all valid entries where as
1922788128 are invalid.
Please let me know which method I should use then I will be able to do it.
[ December 02, 2004: Message edited by: Nee Kat ]
Joined: Dec 06, 2001
Dec 02, 2004 09:31:00
What have you done so far? You may find
to be helpful in parsing out each number that is separated by a period. Also,
has methods for converting a
to an int (assuming that the IP address is input as a String).
Java API Documentation
The Java Tutorial
author and iconoclast
Joined: Jul 08, 2003
Dec 02, 2004 09:46:00
Welcome to JavaRanch!
Please don't post the same question to multiple forums -- it just wastes people's time. I'm going to close this one because this isn't really a beginner question, and leave
[Jess in Action]
I agree. Here's the link:
subject: IP Address format
jboss-4.2.2.GA work with localhost but not work while i m using IP and port
IP Address Format
iPlanet Webserver Problem : Listern Socket Table...
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015