I'm trying to pass an IP address in the form of a string into a method.
If I pass in a string that I read in that contains:
128.120.101.12
I get null.
If I pass in:
"128.120.101.12"
or InputString, where InputString = "128.120.101.12"
I get a valid return value.
Any idea what is wrong?
Thanks!
> I'm trying to pass an IP address in the form of a string into a method.
> If I pass in a string that I read in that contains:
[quoted text clipped - 12 lines]
>
> Any idea what is wrong?
I can't imagine how you managed to "pass in a string" without using the
quotation marks. Try posting an SSCCE. http://mindprod.com/jgloss/sscce.html
- Oliver
nooneinparticular314159@yahoo.com <nooneinparticular314159@yahoo.com>
wrote:
> I'm trying to pass an IP address in the form of a string into a method.
> If I pass in a string that I read in that contains:
[quoted text clipped - 10 lines]
>
> I get a valid return value.
I don't know what you mean by InputString. There is no type called
InputString in the standard Java library. As for the rest, though, I
would check whether the string you're passing in contains any whitespace
or such that might affect the parsing. Try passing the result of
calling trim() on the String, instead of calling directly.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation