Oracle
1Z0-851 · Question #20
Given: 11. String test = "Test A. Test B. Test C."; 12. // insert code here 13. String[] result = test.split(regex); Which regular expression, inserted at line 12, correctly splits test into "Test…
The correct answer is E. String regex = "\\.\\s*". See the full explanation below for the reasoning.
Question
Given: 11. String test = "Test A. Test B. Test C."; 12. // insert code here 13. String[] result = test.split(regex); Which regular expression, inserted at line 12, correctly splits test into "Test A", "Test B", and "Test C"?
Options
- AString regex = "";
- BString regex = " ";
- CString regex = ".*";
- DString regex = "\s";
- EString regex = "\.\s*";
- FString regex = "\w[ .] +";
How the community answered
(36 responses)- B6% (2)
- C11% (4)
- D3% (1)
- E78% (28)
- F3% (1)
Community Discussion
No community discussion yet for this question.