no158
asked on
String ref
Not sure what is going wrong with this but I need some help figuring this out.
I have a String str = n.getNodeValue();
If I do a System.out.println(str) the program will display the information but with whitespaces and newlines
Which leads me to belive that .trim() would be the best option for this kind of thing.
The problem is, when I edit the str in any manor I get a error on that same line the edit took place.
Any idea why this might happen and or a fix for this problem?
code:
String str = n.getNodeValue();
System.out.println(str.tri m()); <-----Error here (when edit takes place to str)
//System.out.pritln(str); <-------------This code would work (format looks bad)
I have a String str = n.getNodeValue();
If I do a System.out.println(str) the program will display the information but with whitespaces and newlines
Which leads me to belive that .trim() would be the best option for this kind of thing.
The problem is, when I edit the str in any manor I get a error on that same line the edit took place.
Any idea why this might happen and or a fix for this problem?
code:
String str = n.getNodeValue();
System.out.println(str.tri
//System.out.pritln(str); <-------------This code would work (format looks bad)
ASKER
NullPointerException
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What is the error that you get
Cheers!