I had to take str=str.trim() out |
||
![]() Cpt SAJChurchey because if the string is null, it will through a NullPointerException. str must first be tested for null before any other functions can be performed on it. I had to use trim twice because I cannot do an assignment and check in the if statement. I could set up two separate if statements though: if(str == null) return ""; str = str.trim(); if(str.length() == 0) return "";Do you think that would be better? Cpt SAJChurchey
C/O of Editorial OSI Staff edit0r OSI Feedback Representative Replies:
|
||
| CyberArmy::Forum v0.6 Generated In 0.02304 seconds |