getting characters out of a string
Hi,
I am trying to compare a users IP address to the servers IP address, but I only want to compare the 1st 7 characters of the users IP address.
I wrote this to print out 2 strings:
<%
String userIP = request.getRemoteAddr();
char[] check = new char[7];
userIP.getBytes( 0, 6, check, 0);
String s = check.toString();
out.write ( "your ip is = " + userIP + "<br><br>" );
out.write ( "first 7 char are = " + s + "<br><br>" );
%>
"String userIP" shows the users IP address (ie 123.456.789.123) and "String s" should show the 1st 7 characters of the users IP (ie 123.456), but its not printing that, its showing something else...what i am lacking?
Thank,
Brent

