Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439

13

Don't forget to count the space.

The trim() Method

Here is a line of the documentation for the

public String trim();

The trim() method of a String objectcreates a new String that is the same as the originalexcept that any leading or trailing space is trimmed off (removed).

QUESTION 14:

Examine the following code:

String userData = "     745   ";String fixed;fixed = userData.trim();

Has the trim() method been used correctly?How many objects have been created?