Question 22 / 90:  You want to remove all leading and trailing whitespace from a string. Which method invocation will allow this to occur?
A  stringName.trim();
B  stringName.trim(' ');
C  stringName.trim(" ");
D  stringName.trimWhiteSpace();
<< First < Previous Flashcard Next > Last >>
Explanation:

A. The method is called trim and it receives no arguments.

B, C, and D are incorrect.

B and C are incorrect because these methods inappropriately try to receive arguments.

D is incorrect because there is no trimWhiteSpace method.

Exam Home Page
https://www.jobilize.com/quiz-my-oca-mock-exam-by-mike-wolf

My OCA Mock

Author:

Access: Public Instant Grading

Ask
David Bourgeois
Start Quiz
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/quiz-my-oca-mock-exam-by-mike-wolf" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>