Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / May 2006

Tip: Looking for answers? Try searching our database.

difference between strings?

Thread view: 
nooneinparticular314159@yahoo.com - 05 May 2006 20:18 GMT
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!
Oliver Wong - 05 May 2006 20:37 GMT
> 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
Chris Smith - 05 May 2006 20:52 GMT
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



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.