|
Examine the following code: String userData = " 745 "; String fixed; fixed = userData.trim(); A good answer might be:
|
The trim() Method
You can answer the questions without knowing what String userData = " 745 "; String fixed; fixed = userData.trim(); The new String referenced by fixed will contain the characters "745" without the surrounding spaces. This is often useful in preparing user input data for conversion from character for to numeric form. |
QUESTION 11:Inspect the following: What is printed out? Click Here after you have answered the questionString dryden = " None but the brave deserves the fair. " ; System.out.println( dryden.trim() ); |